Skip to content

Commit

Permalink
Simplify .filter().next() into .find()
Browse files Browse the repository at this point in the history
I would have thought clippy already complains about this...? Or does the
intermediate .map() confuse it, perhaps?

Signed-off-by: Uli Schlachter <[email protected]>
  • Loading branch information
psychon committed Aug 17, 2024
1 parent 72b3cb2 commit 2695cd9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions x11rb/src/cursor/find_cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ static CORE_CURSORS: &[(&str, u16)] = &[
fn cursor_shape_to_id(name: &str) -> Option<u16> {
CORE_CURSORS
.iter()
.filter(|&(name2, _)| name == *name2)
.find(|&(name2, _)| name == *name2)
.map(|&(_, id)| id)
.next()
}

#[cfg(test)]
Expand Down

0 comments on commit 2695cd9

Please sign in to comment.