Skip to content
This repository was archived by the owner on Dec 7, 2023. It is now read-only.

Commit 5967a6e

Browse files
committed
lint with clippy
1 parent c39c86c commit 5967a6e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,7 @@ pub fn get_original_spans<S: AsRef<str>>(
166166
}
167167
}
168168
// get the rightmost corresponding char
169-
let mut origr = None;
170-
for j in a2b[l..r].iter().rev().flatten() {
171-
origr = Some(j + 1);
172-
break;
173-
}
169+
let mut origr = a2b[l..r].iter().rev().flatten().next().map(|j| j + 1);
174170
// edge case: a token with empty string
175171
if l == r {
176172
if l >= a2b.len() {

0 commit comments

Comments
 (0)