Skip to content

Use rfind rather filter.next_back.#985

Merged
WindSoilder merged 1 commit into
mainfrom
push-tznrprqxswmv
Dec 14, 2025
Merged

Use rfind rather filter.next_back.#985
WindSoilder merged 1 commit into
mainfrom
push-tznrprqxswmv

Conversation

@WindSoilder
Copy link
Copy Markdown
Contributor

I noticed CI error when running clippy:

warning: called `filter(..).next_back()` on an `DoubleEndedIterator`. This is more succinctly expressed by calling `.rfind(..)` instead
   --> src/core_editor/line_buffer.rs:273:9
    |
273 | /         self.lines[..self.insertion_point]
274 | |             .split_word_bound_indices()
275 | |             .filter(|(_, word)| !is_whitespace_str(word))
276 | |             .next_back()
    | |________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#filter_next
    = note: `#[warn(clippy::filter_next)]` on by default
help: try
    |
273 ~         self.lines[..self.insertion_point]
274 +             .split_word_bound_indices().rfind(|(_, word)| !is_whitespace_str(word))
    |

This pr is going to fix it

@WindSoilder WindSoilder merged commit 6482259 into main Dec 14, 2025
6 checks passed
@fdncred fdncred deleted the push-tznrprqxswmv branch December 14, 2025 23:56
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.

1 participant