chore(lint): enable clippy::redundant_clone#170
Open
tupe12334 wants to merge 1 commit into
Open
Conversation
Promote clippy::redundant_clone to deny in core/Cargo.toml, continuing the crate's incremental lint-ratcheting policy. Catches .clone() calls whose result is the last use of the value (the original is dead), which allocate a fresh copy where a move would do. Completes the existing clone-hygiene family (implicit_clone, cloned_instead_of_copied). Zero current violations; clippy/build/test all pass. Closes #169
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.
Closes #169
What
Promotes
clippy::redundant_clonetodenyincore/Cargo.toml, continuing the crate's incremental lint-ratcheting policy (one lint promoted per PR).cloned_instead_of_copied = "deny" +redundant_clone = "deny"Why
clippy::redundant_cloneflags a.clone()whose result is the last use of the value — the original is never touched again, so the clone allocates a fresh copy where a plain move would do. Enabling it:.clone()honest as a signal of "I need an independent copy",implicit_cloneandcloned_instead_of_copied.Validation
There are zero current violations, so this is a clean lock-in / regression guard (matching the other
deny-on-clean lints incore/Cargo.toml). All green:cargo clippy --all-targets— passes (exit 0)cargo build— passescargo test— passesNote:
redundant_cloneis a nursery lint; it is enabled here as a single, conservative, zero-violation addition (no group-wide enablement), consistent with the repo's existing nursery picks (option_if_let_else,missing_const_for_fn).This pull request was opened by the "Clippy lint improvements → issue + PR (Rust repos) → Slack" routine of moadim.