style: clippy fix
This commit is contained in:
parent
b2fea4d5b3
commit
77e4241b18
3 changed files with 3 additions and 3 deletions
|
@ -245,7 +245,7 @@ impl NapiStruct {
|
||||||
}) = &ty
|
}) = &ty
|
||||||
{
|
{
|
||||||
if let Some(last_path) = segments.last() {
|
if let Some(last_path) = segments.last() {
|
||||||
last_path.ident.to_string() == "Option"
|
last_path.ident == "Option"
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,7 +264,7 @@ pub fn ty_to_ts_type(ty: &Type, is_return_ty: bool) -> (String, bool) {
|
||||||
.get(rust_ty.as_str())
|
.get(rust_ty.as_str())
|
||||||
.map(|a| (a.to_owned(), false))
|
.map(|a| (a.to_owned(), false))
|
||||||
});
|
});
|
||||||
ts_ty = type_alias.or_else(|| Some((rust_ty, false)));
|
ts_ty = type_alias.or(Some((rust_ty, false)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ struct AllOptionalObject {
|
||||||
|
|
||||||
#[napi]
|
#[napi]
|
||||||
fn receive_all_optional_object(obj: Option<AllOptionalObject>) -> Result<()> {
|
fn receive_all_optional_object(obj: Option<AllOptionalObject>) -> Result<()> {
|
||||||
if !obj.is_none() {
|
if obj.is_some() {
|
||||||
assert!(obj.as_ref().unwrap().name.is_none());
|
assert!(obj.as_ref().unwrap().name.is_none());
|
||||||
assert!(obj.as_ref().unwrap().age.is_none());
|
assert!(obj.as_ref().unwrap().age.is_none());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue