Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Dec 25, 2024
1 parent 5c10696 commit 047adf2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,8 @@ impl<'a> Parser<'a> {
} else {
let f = {
let prefix = start >= 2
&& self
.input
.get(start - 2..start - 1)
.map_or(false, |s| s == "/");
let suffix = self.cursor.peek().map_or(true, |(_, c)| *c == '/');
&& (self.input.get(start - 2..start - 1) == Some("/"));
let suffix = self.cursor.peek().is_none_or(|(_, c)| *c == '/');
prefix && suffix
};
if c == '?' {
Expand Down Expand Up @@ -169,9 +166,8 @@ impl Iterator for Parser<'_> {
Kind::OneOrMore
} else {
let f = {
let prefix =
i >= 1 && self.input.get(i - 1..i).map_or(false, |s| s == "/");
let suffix = self.cursor.peek().map_or(true, |(_, c)| *c == '/');
let prefix = i >= 1 && (self.input.get(i - 1..i) == Some("/"));
let suffix = self.cursor.peek().is_none_or(|(_, c)| *c == '/');
prefix && suffix
};
if f {
Expand Down

0 comments on commit 047adf2

Please sign in to comment.