Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy errors #206

Merged
merged 1 commit into from
Jul 17, 2020
Merged

Fix clippy errors #206

merged 1 commit into from
Jul 17, 2020

Conversation

ionut-arm
Copy link
Member

This commit fixes clippy warnings in the new version of the Rust compiler
(1.45.0). Most of the errors refer to misuse of or_else, where an
error is mapped exclusively to another error. map_err should be used
instead. The other warnings are around useless type conversions between
identical types.

Signed-off-by: Ionut Mihalcea [email protected]

@ionut-arm ionut-arm added the bug Something isn't working label Jul 17, 2020
@ionut-arm ionut-arm requested a review from hug-dev July 17, 2020 10:09
@ionut-arm ionut-arm self-assigned this Jul 17, 2020
This commit fixes clippy warnings in the new version of the Rust compiler
(1.45.0). Most of the errors refer to misuse of `or_else`, where an
error is mapped exclusively to another error. `map_err` should be used
instead. The other warnings are around useless type conversions between
identical types.

Signed-off-by: Ionut Mihalcea <[email protected]>
.unwrap();
let _res = client
.asymmetric_decrypt_message_with_rsapkcs1v15(key_name_2.clone(), ciphertext)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure that clippy warned us for issues similar than this one before!

@@ -153,7 +153,7 @@ impl Pkcs11Provider {
let key_name = op.key_name;
let key_attributes = op.attributes;
// This should never panic on 32 bits or more machines.
let key_size = std::convert::TryFrom::try_from(op.attributes.bits).unwrap();
let key_size = op.attributes.bits;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use clippy, don't panic 😎

@ionut-arm ionut-arm merged commit adaf587 into parallaxsecond:master Jul 17, 2020
@ionut-arm ionut-arm deleted the fix-clippy branch July 17, 2020 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants