Skip to content

Commit 047adf2

Browse files
committed
clippy
1 parent 5c10696 commit 047adf2

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/parser.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,8 @@ impl<'a> Parser<'a> {
108108
} else {
109109
let f = {
110110
let prefix = start >= 2
111-
&& self
112-
.input
113-
.get(start - 2..start - 1)
114-
.map_or(false, |s| s == "/");
115-
let suffix = self.cursor.peek().map_or(true, |(_, c)| *c == '/');
111+
&& (self.input.get(start - 2..start - 1) == Some("/"));
112+
let suffix = self.cursor.peek().is_none_or(|(_, c)| *c == '/');
116113
prefix && suffix
117114
};
118115
if c == '?' {
@@ -169,9 +166,8 @@ impl Iterator for Parser<'_> {
169166
Kind::OneOrMore
170167
} else {
171168
let f = {
172-
let prefix =
173-
i >= 1 && self.input.get(i - 1..i).map_or(false, |s| s == "/");
174-
let suffix = self.cursor.peek().map_or(true, |(_, c)| *c == '/');
169+
let prefix = i >= 1 && (self.input.get(i - 1..i) == Some("/"));
170+
let suffix = self.cursor.peek().is_none_or(|(_, c)| *c == '/');
175171
prefix && suffix
176172
};
177173
if f {

0 commit comments

Comments
 (0)