Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/graphemes.rs')
-rw-r--r--helix-core/src/graphemes.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-core/src/graphemes.rs b/helix-core/src/graphemes.rs
index e6adeee9..33d237cb 100644
--- a/helix-core/src/graphemes.rs
+++ b/helix-core/src/graphemes.rs
@@ -64,7 +64,7 @@ impl<'a> Grapheme<'a> {
}
pub fn is_whitespace(&self) -> bool {
- !matches!(&self, Grapheme::Other { g } if !g.chars().all(char_is_whitespace))
+ !matches!(&self, Grapheme::Other { g } if !g.chars().next().is_some_and(char_is_whitespace))
}
// TODO currently word boundaries are used for softwrapping.
@@ -72,7 +72,7 @@ impl<'a> Grapheme<'a> {
// This could however be improved in the future by considering unicode
// character classes but
pub fn is_word_boundary(&self) -> bool {
- !matches!(&self, Grapheme::Other { g,.. } if g.chars().all(char_is_word))
+ !matches!(&self, Grapheme::Other { g,.. } if g.chars().next().is_some_and(char_is_word))
}
}