Skip to content

Commit

Permalink
Use find(...) instead of filter(...).next()
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Feb 21, 2024
1 parent 1ddfb77 commit 4742f3f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions widget/src/text_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,7 @@ impl Update {
..
} if state.is_focused => {
if let Some(text) = text {
if let Some(c) =
text.chars().filter(|c| !c.is_control()).next()
if let Some(c) = text.chars().find(|c| !c.is_control())
{
return edit(Edit::Insert(c));
}
Expand Down

0 comments on commit 4742f3f

Please sign in to comment.