Skip to content

refactor: apply clippy::into_iter_on_ref#6910

Closed
shulaoda wants to merge 1 commit into
rust-lang:mainfrom
shulaoda:05-23-refactor_apply_clippy_into_iter_on_ref
Closed

refactor: apply clippy::into_iter_on_ref#6910
shulaoda wants to merge 1 commit into
rust-lang:mainfrom
shulaoda:05-23-refactor_apply_clippy_into_iter_on_ref

Conversation

@shulaoda
Copy link
Copy Markdown
Contributor

Summary

  • In src/cargo-fmt/main.rs::get_targets_with_hitlist, replaces hitlist.into_iter().map(|s| s.as_str()) with hitlist.iter().map(|s| s.as_str()).
  • Addresses clippy::into_iter_on_ref, run as a single-rule pass: cargo clippy -- -A clippy::all -W clippy::into_iter_on_ref.

Calling into_iter() on a reference is misleading — it does not consume the collection, it just yields &T (same as iter()). Spelling it iter() matches what the code actually does.

@rustbot rustbot added the S-waiting-on-review Status: awaiting review from the assignee but also interested parties. label May 22, 2026
@ytmimi
Copy link
Copy Markdown
Contributor

ytmimi commented May 22, 2026

Going to close until we decide on which clippy lints we want to enforce in the codebase.

@ytmimi ytmimi closed this May 22, 2026
@rustbot rustbot removed the S-waiting-on-review Status: awaiting review from the assignee but also interested parties. label May 22, 2026
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.

3 participants