Skip to content

Commit

Permalink
Fix clippy issues
Browse files Browse the repository at this point in the history
Signed-off-by: Ionut Mihalcea <[email protected]>
  • Loading branch information
ionut-arm committed May 7, 2021
1 parent 59824b9 commit 6152170
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
12 changes: 6 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ fn generate_ts_bindings(ts_include_dir: String) -> Result<()> {
.generate_comments(false)
.size_t_is_usize(true)
.generate()
.or_else(|_| {
Err(Error::new(
.map_err(|_| {
Error::new(
ErrorKind::Other,
"Unable to generate bindings to trusted services locator",
))
)
})?;
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings.write_to_file(out_path.join("ts_bindings.rs"))?;
Expand Down Expand Up @@ -49,11 +49,11 @@ fn generate_proto_sources(contract_dir: String) -> Result<()> {
.path()
.into_os_string()
.into_string()
.or_else(|_| {
Err(Error::new(
.map_err(|_| {
Error::new(
ErrorKind::InvalidData,
"conversion from OsString to String failed",
))
)
})
})
// Fail the entire operation if there was an error.
Expand Down
5 changes: 1 addition & 4 deletions src/providers/mbed_crypto/asym_encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ impl Provider {
let id = key::Id::from_persistent_key_id(key_id)?;
let key_attributes = key::Attributes::from_key_id(id)?;
op.validate(key_attributes)?;
let salt_buff = match &op.salt {
Some(salt) => Some(salt.as_slice()),
None => None,
};
let salt_buff = op.salt.as_ref().map(|salt| salt.as_slice());
let buffer_size = key_attributes.asymmetric_decrypt_output_size(op.alg)?;
let mut plaintext = vec![0u8; buffer_size];

Expand Down

0 comments on commit 6152170

Please sign in to comment.