chore: clean up 17 clippy warnings on stable (#16)#21
Merged
Conversation
Address all 17 clippy warnings reported on stable so the CI lint job can flip to -D warnings. Changes: - needless_borrow: drop & in conditional_select calls. - let_and_return: drop temporary in waters/waters_naccache decrypt. - non_canonical_clone_impl: replace manual Clone impls on Copy types with `*self` (Parameters in waters & kiltz_vahlis_one, Identity in waters). - needless_range_loop: switch index-based loops in to_bytes / from_bytes to enumerate-over-iter_mut(). - wrong_self_convention: change to_bytes(&self) to to_bytes(self) on the three Copy parameter types (waters::Parameters, waters_naccache::Parameters, kiltz_vahlis_one::HashParameters). These are pub but the types themselves are crate-private (only reached via PublicKey::to_bytes), so this is source-compatible for downstream callers. No behavior changes. cargo clippy --all-features --all-targets exits clean. cargo test --release --all-features: 17/17 pass. cargo check --no-default-features (wasm32) builds. Closes #16
rubenhensen
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cleans up the 17 cosmetic clippy warnings reported in #16 so the Lint CI job can later flip to
-D warnings.Categories addressed:
needless_borrow— drop&inconditional_selectcalls (waters, waters_naccache, kiltz_vahlis_one).let_and_return— drop the temporary indecrypt(waters, waters_naccache).non_canonical_clone_impl— replace manualCloneonCopytypes with*self(waters::Parameters, waters::Identity, kiltz_vahlis_one::HashParameters).needless_range_loop— switch theto_bytes/from_bytesindex loops to enumerate overiter()/iter_mut().wrong_self_convention— changeto_bytes(&self)toto_bytes(self)on the threeCopyparam types. These methods arepubon crate-private structs (only reached viaPublicKey::to_bytes), so this does not break downstream callers.No behaviour changes.
Closes #16.
Verification
cargo clippy --all-features --all-targets— clean (0 warnings).cargo test --release --all-features— 17/17 pass.cargo check --no-default-features --target wasm32-unknown-unknown— builds.cargo fmt --all -- --check— clean.Reviewer quickstart
```
git fetch origin && git checkout fix/clippy-cleanup-issue-16 && cargo clippy --all-features --all-targets && cargo test --release --all-features
```
Kept as draft until CI confirms green.