Skip to content

Commit dacc84c

Browse files
paolobarbolinimaxbachmann
authored andcommitted
Fix clippy warnings
1 parent 43d4443 commit dacc84c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/lib.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,7 @@ where
113113

114114
for (i, a_elem) in a.into_iter().enumerate() {
115115
// prevent integer wrapping
116-
let min_bound = if i > search_range {
117-
i - search_range
118-
} else {
119-
0
120-
};
116+
let min_bound = i.saturating_sub(search_range);
121117

122118
let max_bound = min(b_len, i + search_range + 1);
123119

@@ -165,7 +161,7 @@ where
165161

166162
struct StringWrapper<'a>(&'a str);
167163

168-
impl<'a, 'b> IntoIterator for &'a StringWrapper<'b> {
164+
impl<'b> IntoIterator for &StringWrapper<'b> {
169165
type Item = char;
170166
type IntoIter = Chars<'b>;
171167

0 commit comments

Comments
 (0)