Skip to content

Commit 0360155

Browse files
authored
Fix lint errors (#311)
1 parent c7171d9 commit 0360155

File tree

2 files changed

+5
-5
lines changed
  • crates/ubrn_bindgen/src/bindings/gen_rust
  • fixtures/custom-types-example/src

2 files changed

+5
-5
lines changed

crates/ubrn_bindgen/src/bindings/gen_rust/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,9 @@ impl<'a> ComponentTemplate<'a> {
653653

654654
fn ffi_type_uniffi_result(&self, t: Option<&FfiType>) -> TokenStream {
655655
let runtime_ident = self.runtime_ident();
656-
if t.is_none() {
657-
quote! { #runtime_ident::UniffiResultVoid }
658-
} else {
659-
match t.unwrap() {
656+
match t {
657+
None => quote! { #runtime_ident::UniffiResultVoid },
658+
Some(t) => match t {
660659
FfiType::UInt8 => quote! { #runtime_ident::UniffiResultUInt8 },
661660
FfiType::UInt16 => quote! { #runtime_ident::UniffiResultUInt16 },
662661
FfiType::UInt32 => quote! { #runtime_ident::UniffiResultUInt32 },
@@ -679,7 +678,7 @@ impl<'a> ComponentTemplate<'a> {
679678
self.ffi_type_uniffi_result(Some(t))
680679
}
681680
_ => unreachable!("Uniffi doesn't support returning {t:?} from callbacks"),
682-
}
681+
},
683682
}
684683
}
685684

fixtures/custom-types-example/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ impl From<Handle> for i64 {
4444
}
4545
}
4646

47+
#[allow(clippy::infallible_try_from)]
4748
impl TryFrom<i64> for Handle {
4849
type Error = std::convert::Infallible;
4950

0 commit comments

Comments
 (0)