Skip to content

Commit 6884202

Browse files
committed
Made local variable immutable by moving it into loop
1 parent 3b75ee1 commit 6884202

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
@@ -172,14 +172,13 @@ impl<'a> Iterator for UWordBounds<'a> {
172172
let mut cat = wd::WC_Any;
173173
let mut savecat = wd::WC_Any;
174174

175-
// Whether or not the previous category was ZWJ
176-
// ZWJs get collapsed, so this handles precedence of WB3c over WB4
177-
let mut prev_zwj;
178175
// If extend/format/zwj were skipped. Handles precedence of WB3d over WB4
179176
let mut skipped_format_extend = false;
180177
for (curr, ch) in self.string.char_indices() {
181178
idx = curr;
182-
prev_zwj = cat == wd::WC_ZWJ;
179+
// Whether or not the previous category was ZWJ
180+
// ZWJs get collapsed, so this handles precedence of WB3c over WB4
181+
let prev_zwj = cat == wd::WC_ZWJ;
183182
// if there's a category cached, grab it
184183
cat = match self.cat {
185184
None => wd::word_category(ch).2,

0 commit comments

Comments
 (0)