mirror of
https://git.proxmox.com/git/pathpatterns
synced 2025-07-27 07:49:14 +00:00
clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
fcabdb9028
commit
7e4c3e0987
@ -317,7 +317,7 @@ impl Pattern {
|
|||||||
}
|
}
|
||||||
b'[' if pattern[(i + 1)..].starts_with(b":print:]") => {
|
b'[' if pattern[(i + 1)..].starts_with(b":print:]") => {
|
||||||
i += 8;
|
i += 8;
|
||||||
class.named.push(|b| b >= 0x20 && b <= 0x7f);
|
class.named.push(|b| (0x20..=0x7f).contains(&b));
|
||||||
}
|
}
|
||||||
b'[' if pattern[(i + 1)..].starts_with(b":punct:]") => {
|
b'[' if pattern[(i + 1)..].starts_with(b":punct:]") => {
|
||||||
i += 8;
|
i += 8;
|
||||||
@ -397,10 +397,7 @@ impl Pattern {
|
|||||||
|
|
||||||
/// Check whether this pattern matches a text.
|
/// Check whether this pattern matches a text.
|
||||||
pub fn matches<T: AsRef<[u8]>>(&self, text: T) -> bool {
|
pub fn matches<T: AsRef<[u8]>>(&self, text: T) -> bool {
|
||||||
match self.do_matches(0, text.as_ref(), false) {
|
matches!(self.do_matches(0, text.as_ref(), false), MatchResult::Match)
|
||||||
MatchResult::Match => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The algorithm is ported from git's wildmatch.c.
|
// The algorithm is ported from git's wildmatch.c.
|
||||||
@ -436,7 +433,7 @@ impl Pattern {
|
|||||||
literal
|
literal
|
||||||
};
|
};
|
||||||
|
|
||||||
if !starts_with(text, &literal, self.flags) {
|
if !starts_with(text, literal, self.flags) {
|
||||||
return MatchResult::NoMatch;
|
return MatchResult::NoMatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user