From 5bec40474dbfa7171595766e4e078a7b8ab70f86 Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Tue, 16 Dec 2025 16:23:38 +0100 Subject: [PATCH 1/2] Fix warnings --- src/lib.rs | 4 ++-- src/word.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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..cc8e2b1 100644 --- a/src/word.rs +++ b/src/word.rs @@ -1028,7 +1028,7 @@ mod tests { }; use std::string::String; use std::vec::Vec; - use std::{format, vec}; + use std::{vec}; use proptest::prelude::*; From 7285518914006b20099d189f17304f3bb9d987dc Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Tue, 16 Dec 2025 09:08:43 -0800 Subject: [PATCH 2/2] fix --- src/grapheme.rs | 4 ++-- src/word.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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/word.rs b/src/word.rs index cc8e2b1..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::{vec}; use proptest::prelude::*;