Skip to content

Commit

Permalink
Fix clippy suggestion (#1310), Fixes for nightly changes (#1327)
Browse files Browse the repository at this point in the history
  • Loading branch information
agryaznov committed Oct 18, 2022
1 parent b540250 commit adf1636
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
4 changes: 1 addition & 3 deletions crates/lang/ir/src/ir/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ impl TryFrom<ast::AttributeArgs> for Config {
))
}
} else if arg.name.is_ident("keep_attr") {
if let Err(err) = whitelisted_attributes.parse_arg_value(&arg) {
return Err(err)
}
whitelisted_attributes.parse_arg_value(&arg)?;
} else {
return Err(format_err_spanned!(
arg,
Expand Down
4 changes: 1 addition & 3 deletions crates/lang/ir/src/ir/trait_def/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ impl TryFrom<ast::AttributeArgs> for TraitDefinitionConfig {
))
}
} else if arg.name.is_ident("keep_attr") {
if let Err(err) = whitelisted_attributes.parse_arg_value(&arg) {
return Err(err)
}
whitelisted_attributes.parse_arg_value(&arg)?;
} else {
return Err(format_err_spanned!(
arg,
Expand Down
2 changes: 1 addition & 1 deletion crates/lang/ir/src/ir/trait_def/item/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl InkItemTrait {

/// Constructors are generally not allowed in ink! trait definitions.
fn analyse_trait_constructor(constructor: &syn::TraitItemMethod) -> Result<()> {
return Err(format_err!(
Err(format_err!(
constructor.span(),
"ink! trait definitions must not have constructors",
))
Expand Down
12 changes: 4 additions & 8 deletions crates/lang/ir/src/ir/trait_def/item/trait_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,10 @@ impl<'a> InkTraitMessage<'a> {
true
}
syn::FnArg::Typed(pat_type) => {
match &*pat_type.ty {
syn::Type::Reference(reference)
if reference.mutability.is_some() =>
{
true
}
_ => false,
}
matches!(
&*pat_type.ty,
syn::Type::Reference(reference) if reference.mutability.is_some()
)
}
_ => false,
}
Expand Down

0 comments on commit adf1636

Please sign in to comment.