Skip to content

Commit 1d3e87d

Browse files
authored
Merge pull request #92 from YohDeadfall/immutable-local
Made local variable immutable by moving it into loop
2 parents cea3ce6 + 6884202 commit 1d3e87d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/word.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,13 @@ impl<'a> Iterator for UWordBounds<'a> {
200200
let mut cat = wd::WC_Any;
201201
let mut savecat = wd::WC_Any;
202202

203-
// Whether or not the previous category was ZWJ
204-
// ZWJs get collapsed, so this handles precedence of WB3c over WB4
205-
let mut prev_zwj;
206203
// If extend/format/zwj were skipped. Handles precedence of WB3d over WB4
207204
let mut skipped_format_extend = false;
208205
for (curr, ch) in self.string.char_indices() {
209206
idx = curr;
210-
prev_zwj = cat == wd::WC_ZWJ;
207+
// Whether or not the previous category was ZWJ
208+
// ZWJs get collapsed, so this handles precedence of WB3c over WB4
209+
let prev_zwj = cat == wd::WC_ZWJ;
211210
// if there's a category cached, grab it
212211
cat = match self.cat {
213212
None => wd::word_category(ch).2,

0 commit comments

Comments
 (0)