Skip to content

refactor: apply clippy::needless_splitn#6907

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

refactor: apply clippy::needless_splitn#6907
shulaoda wants to merge 1 commit into
rust-lang:mainfrom
shulaoda:05-23-refactor_apply_clippy_needless_splitn

Conversation

@shulaoda
Copy link
Copy Markdown
Contributor

Summary

  • Replaces splitn(2, ..).next() with split(..).next() in
    src/overflow.rs and src/visitor.rs.
  • Replaces rsplitn(2, ..).next() with rsplit(..).next() in
    src/utils.rs.
  • Addresses clippy::needless_splitn, run as a single-rule pass:
    cargo clippy -- -A clippy::all -W clippy::needless_splitn.

When only the first element is consumed, the splitn(2, ..) upper bound
is redundant — split / rsplit are equally lazy iterators. Pure
refactor, no behavior changes intended. Touches 3 files.

@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