Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
haerdib committed Oct 25, 2023
1 parent f7626ae commit d394cdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions node-api/src/metadata/from_v14_to_v15.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn generate_outer_enums(
) -> Result<v15::OuterEnums<scale_info::form::PortableForm>, 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
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion node-api/src/metadata/variant_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl VariantIndex {
variant_id: Option<u32>,
types: &PortableRegistry,
) -> Option<&[Variant<PortableForm>]> {
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)
}
Expand Down

0 comments on commit d394cdb

Please sign in to comment.