fix clippy lints

This commit is contained in:
2025-11-15 01:55:19 +00:00
parent dfaad015b9
commit 0436fbc770
5 changed files with 44 additions and 45 deletions

View File

@@ -77,7 +77,7 @@ impl<'a> Parseable<'a, &'a str> for VersionNumbers {
.map(|output: &str| VersionNumber(output.to_string()))
.separated_by(tag("."))
.at_least(1)
.map(|numbers| VersionNumbers(numbers))
.map(VersionNumbers)
}
}
@@ -88,7 +88,7 @@ impl<'a> Parseable<'a, &'a str> for VersionSuffixes {
VersionSuffix::parser()
.separated_by(tag("_"))
.at_least(1)
.map(|suffixes| VersionSuffixes(suffixes))
.map(VersionSuffixes)
}
}
@@ -180,8 +180,8 @@ impl<'a> Parseable<'a, &'a str> for Slot {
.opt()
.and(SlotName::parser().preceded_by(tag("/")).opt())
.and(SlotOperator::parser().opt())
.map(|((slot, sub), operator)| Slot {
slot,
.map(|((primary, sub), operator)| Slot {
primary,
sub,
operator,
})
@@ -201,6 +201,7 @@ impl<'a> Parseable<'a, &'a str> for UseDepSign {
impl<'a> Parseable<'a, &'a str> for UseDep {
type Parser = impl Parser<&'a str, Output = Self>;
#[allow(clippy::many_single_char_names)]
fn parser() -> Self::Parser {
let a = UseFlag::parser()
.and(UseDepSign::parser().opt())
@@ -321,7 +322,7 @@ impl<'a> Parseable<'a, &'a str> for Atom {
.numbers()
.get()
.iter()
.any(|number| number.get().contains("*")) =>
.any(|number| number.get().contains('*')) =>
{
true
}
@@ -414,7 +415,7 @@ mod test {
fn test_invalid_usedep() {
let it = InputIter::new("foo-bar:slot/sub=[!use]");
assert!(Atom::parser().check_finished(it).is_err())
assert!(Atom::parser().check_finished(it).is_err());
}
#[test]