Skip to content

Commit

Permalink
Fixes for nightly changes (#1327)
Browse files Browse the repository at this point in the history
* Fix `clippy::question_mark`

* Fix `clippy::match_like_matches_macro`

* Update test fixtures

	cd crates/lang/
	export TRYBUILD=overwrite
	cargo test --verbose --all-features --no-fail-fast
  • Loading branch information
cmichi authored Jul 20, 2022
1 parent 604976c commit 4403937
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 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
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
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ error[E0599]: the method `fire` exists for struct `ink_env::call::CallBuilder<De
= note: the following trait bounds were not satisfied:
`NonCodecType: parity_scale_codec::Decode`
note: the following trait must be implemented
--> $CARGO/parity-scale-codec-3.1.5/src/codec.rs
--> $CARGO/parity-scale-codec-3.1.2/src/codec.rs
|
| pub trait Decode: Sized {
| ^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ error[E0599]: the method `fire` exists for struct `CallBuilder<E, Set<Call<E>>,
= note: the following trait bounds were not satisfied:
`NonCodec: parity_scale_codec::Decode`
note: the following trait must be implemented
--> $CARGO/parity-scale-codec-3.1.5/src/codec.rs
--> $CARGO/parity-scale-codec-3.1.2/src/codec.rs
|
| pub trait Decode: Sized {
| ^^^^^^^^^^^^^^^^^^^^^^^

0 comments on commit 4403937

Please sign in to comment.