diff --git a/node-api/src/metadata/from_v14_to_v15.rs b/node-api/src/metadata/from_v14_to_v15.rs index 10e8ce473..9cad7ee24 100644 --- a/node-api/src/metadata/from_v14_to_v15.rs +++ b/node-api/src/metadata/from_v14_to_v15.rs @@ -180,7 +180,7 @@ fn generate_outer_enums( ) -> Result, MetadataConversionError> { let find_type = |name: &str| { metadata.types.types.iter().find_map(|ty| { - let Some(ident) = ty.ty.path.ident() else { return None }; + let ident = ty.ty.path.ident()?; if ident != name { return None @@ -228,7 +228,7 @@ fn generate_outer_error_enum_type( .pallets .iter() .filter_map(|pallet| { - let Some(error) = &pallet.error else { return None }; + let error = &pallet.error.clone()?; let path = format!("{}Error", pallet.name); let ty = error.ty.id.into(); diff --git a/node-api/src/metadata/variant_index.rs b/node-api/src/metadata/variant_index.rs index 815559483..fc861ea5d 100644 --- a/node-api/src/metadata/variant_index.rs +++ b/node-api/src/metadata/variant_index.rs @@ -45,7 +45,7 @@ impl VariantIndex { variant_id: Option, types: &PortableRegistry, ) -> Option<&[Variant]> { - let Some(variant_id) = variant_id else { return None }; + let variant_id = variant_id?; let TypeDef::Variant(v) = &types.resolve(variant_id)?.type_def else { return None }; Some(&v.variants) }