Skip to content

chore: clean up 17 clippy warnings on stable (#16)#21

Merged
rubenhensen merged 1 commit into
mainfrom
fix/clippy-cleanup-issue-16
May 5, 2026
Merged

chore: clean up 17 clippy warnings on stable (#16)#21
rubenhensen merged 1 commit into
mainfrom
fix/clippy-cleanup-issue-16

Conversation

@dobby-coder
Copy link
Copy Markdown
Contributor

@dobby-coder dobby-coder Bot commented May 5, 2026

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 & in conditional_select calls (waters, waters_naccache, kiltz_vahlis_one).
  • let_and_return — drop the temporary in decrypt (waters, waters_naccache).
  • non_canonical_clone_impl — replace manual Clone on Copy types with *self (waters::Parameters, waters::Identity, kiltz_vahlis_one::HashParameters).
  • needless_range_loop — switch the to_bytes / from_bytes index loops to enumerate over iter() / iter_mut().
  • wrong_self_convention — change to_bytes(&self) to to_bytes(self) on the three Copy param types. These methods are pub on crate-private structs (only reached via PublicKey::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.

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
@dobby-coder dobby-coder Bot requested a review from rubenhensen May 5, 2026 15:05
@dobby-coder dobby-coder Bot marked this pull request as ready for review May 5, 2026 15:07
@rubenhensen rubenhensen merged commit 174de49 into main May 5, 2026
6 checks passed
@dobby-coder dobby-coder Bot deleted the fix/clippy-cleanup-issue-16 branch May 5, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clippy cleanup: 17 warnings on stable (cosmetic)

1 participant