-
Notifications
You must be signed in to change notification settings - Fork 297
chore: apply unreachable_pub
lint to crates
#734
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
Conversation
unreachable_pub
lint to subset of crates
unreachable_pub
lint to subset of cratesunreachable_pub
lint to crates
I don't think I agree with this lint. It's pretty common in my experience to define a |
@tarcieri |
I'm a fan of using If it's just |
Ok, let's move forward with it then. @TomAFrench |
ripemd/src/c320.rs
Outdated
); | ||
|
||
pub fn compress(h: &mut [u32; DIGEST_BUF_LEN], data: &[u8; 64]) { | ||
pub(crate) fn compress(h: &mut [u32; DIGEST_BUF_LEN], data: &[u8; 64]) { |
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's better to use either pub(crate)
or pub(super)
for both the function and the constants.
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.
Agreed, I've changed the remaining uses of super
to basically just cover the architecture-specific compression functions as these are the only items which should definitely never be imported elsewhere in the crate.
Should be good to go now |
Thank you! |
This PR rolls out the
unreachable_pub
lint over all the crates, fixing any issues raised. These are either items which have not been exported for quite some time or are very clearly internal implementation details.I've used an inner attribute to activate the lint - my preference for this is to use the linting system in cargo.toml as it makes it easiest to enforce consistency over multiple crates but I didn't want to cause a split with the existing config.