Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix clippy: call next_back instead of last on DoubleEndedIterator #902

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

WindSoilder
Copy link
Contributor

Fixes clippy(version 0.1.86) error:

error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
   --> src/core_editor/line_buffer.rs:474:14
    |
474 |             .last()
    |              ^^^^^^ help: try: `next_back()`

@WindSoilder WindSoilder changed the title fix clippy: call next_back instead of last on DoubleEndedIterator fix clippy: call next_back instead of last on DoubleEndedIterator Apr 4, 2025
Copy link
Member

@sholderbach sholderbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@sholderbach sholderbach merged commit 03cc365 into nushell:main Apr 4, 2025
6 checks passed
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.

2 participants