diff --git a/src/grapheme.rs b/src/grapheme.rs index b09efed..4d189f3 100644 --- a/src/grapheme.rs +++ b/src/grapheme.rs @@ -517,14 +517,14 @@ impl GraphemeCursor { for ch in chunk.chars().rev() { if self.grapheme_category(ch) != gr::GC_Regional_Indicator { self.ris_count = Some(ris_count); - self.decide((ris_count % 2) == 0); + self.decide(ris_count.is_multiple_of(2)); return; } ris_count += 1; } self.ris_count = Some(ris_count); if chunk_start == 0 { - self.decide((ris_count % 2) == 0); + self.decide(ris_count.is_multiple_of(2)); } else { self.pre_context_offset = Some(chunk_start); self.state = GraphemeState::Regional; diff --git a/src/lib.rs b/src/lib.rs index d15ac0b..cf51fd7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -258,7 +258,7 @@ impl UnicodeSegmentation for str { } #[inline] - fn grapheme_indices(&self, is_extended: bool) -> GraphemeIndices { + fn grapheme_indices(&self, is_extended: bool) -> GraphemeIndices<'_> { grapheme::new_grapheme_indices(self, is_extended) } @@ -293,7 +293,7 @@ impl UnicodeSegmentation for str { } #[inline] - fn split_sentence_bound_indices(&self) -> USentenceBoundIndices { + fn split_sentence_bound_indices(&self) -> USentenceBoundIndices<'_> { sentence::new_sentence_bound_indices(self) } } diff --git a/src/word.rs b/src/word.rs index 1a46b39..b265709 100644 --- a/src/word.rs +++ b/src/word.rs @@ -1027,8 +1027,8 @@ mod tests { new_ascii_word_bound_indices, new_unicode_words_ascii, new_word_bound_indices, }; use std::string::String; + use std::vec; use std::vec::Vec; - use std::{format, vec}; use proptest::prelude::*;