-
Notifications
You must be signed in to change notification settings - Fork 10
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): only expose pub functions that need to be public #277
Conversation
25bfc87
to
e95d12f
Compare
e95d12f
to
57df732
Compare
57df732
to
a653a77
Compare
crate/cli/src/actions/login.rs
Outdated
@@ -114,7 +114,7 @@ pub struct LoginState { | |||
|
|||
impl LoginState { | |||
#[must_use] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why there is a must-use here since there is not copy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right and furthermore function is never used.
.unwrap_or_else(|| vec![0_u8; AES_256_GCM_MAC_LENGTH]) | ||
.try_into()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks strange to initialize to an empty vec only to convert it right away. Maybe the conversion can come before the unwrapping to allow initializing an empty array directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed. But this initialization happens only if authenticated_encryption_tag
is None.
@@ -14,6 +14,7 @@ | |||
|
|||
#![allow(non_camel_case_types)] | |||
#![allow(non_snake_case)] | |||
#![allow(clippy::unreadable_literal)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it necessary? Maybe add a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -86,7 +87,6 @@ impl KMS { | |||
/// - "_kk" | |||
/// - the KMIP cryptographic algorithm in lower case prepended with "_" | |||
pub(crate) fn create_symmetric_key_and_tags( | |||
&self, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not a performance improvement but is a rather big change: isn't it better to preserve the symmetry/usual interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Since create_symmetric_key_and_tags
is only use once (and locally), I would rather change it now.
1210b83
to
e501984
Compare
e501984
to
3011860
Compare
3011860
to
d5aff03
Compare
unreachable-pub
)unused_async
)unused_self
)or_fun_call
:The function will always be called. This is only bad if it allocates or does some non-trivial amount of work.
clippy::nursery
)manual_let_else
andif_not_else
for readability