Skip to content

Commit

Permalink
Fix clippy suggestions (use-ink#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascjones authored Mar 9, 2022
1 parent 539debf commit 181eed0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/cmd/extrinsics/instantiate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ impl<'a> Exec<'a> {

let code_stored = result
.find_first::<api::contracts::events::CodeStored>()?
.ok_or(anyhow!("Failed to find CodeStored event"))?;
.ok_or_else(|| anyhow!("Failed to find CodeStored event"))?;
let instantiated = result
.find_first::<api::contracts::events::Instantiated>()?
.ok_or(anyhow!("Failed to find Instantiated event"))?;
.ok_or_else(|| anyhow!("Failed to find Instantiated event"))?;

Ok((code_stored.code_hash, instantiated.contract))
}
Expand Down Expand Up @@ -273,7 +273,7 @@ impl<'a> Exec<'a> {

let instantiated = result
.find_first::<api::contracts::events::Instantiated>()?
.ok_or(anyhow!("Failed to find Instantiated event"))?;
.ok_or_else(|| anyhow!("Failed to find Instantiated event"))?;

Ok(instantiated.contract)
}
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/extrinsics/transcode/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ impl<'a> Encoder<'a> {
let variant_ident = match value {
Value::Map(map) => map
.ident()
.ok_or(anyhow::anyhow!("Missing enum variant identifier for map")),
.ok_or_else(|| anyhow::anyhow!("Missing enum variant identifier for map")),
Value::Tuple(tuple) => tuple
.ident()
.ok_or(anyhow::anyhow!("Missing enum variant identifier for tuple")),
.ok_or_else(|| anyhow::anyhow!("Missing enum variant identifier for tuple")),
v => Err(anyhow::anyhow!("Invalid enum variant value '{:?}'", v)),
}?;

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/extrinsics/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl UploadCommand {

let code_stored = result
.find_first::<api::contracts::events::CodeStored>()?
.ok_or(anyhow::anyhow!("Failed to find CodeStored event"))?;
.ok_or_else(|| anyhow::anyhow!("Failed to find CodeStored event"))?;

Ok(code_stored)
}
Expand Down

0 comments on commit 181eed0

Please sign in to comment.