Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jfecher committed Jul 31, 2024
1 parent 797f41f commit 01f93cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions compiler/noirc_frontend/src/elaborator/comptime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ impl<'context> Elaborator<'context> {

/// Parses an attribute in the form of a function call (e.g. `#[foo(a b, c d)]`) into
/// the function and quoted arguments called (e.g. `("foo", vec![(a b, location), (c d, location)])`)
#[allow(clippy::type_complexity)]
fn parse_attribute(
annotation: &str,
file: FileId,
Expand Down Expand Up @@ -219,11 +220,10 @@ impl<'context> Elaborator<'context> {

if *param_type == Type::Quoted(crate::QuotedType::TraitDefinition) {
let trait_id = match arg.kind {
ExpressionKind::Variable(path) => {
interpreter.elaborator.resolve_trait_by_path(path).ok_or_else(|| {
InterpreterError::FailedToResolveTraitDefinition { location }
})
}
ExpressionKind::Variable(path) => interpreter
.elaborator
.resolve_trait_by_path(path)
.ok_or(InterpreterError::FailedToResolveTraitDefinition { location }),
_ => Err(InterpreterError::TraitDefinitionMustBeAPath { location }),
}?;
push_arg(Value::TraitDefinition(trait_id));
Expand Down
2 changes: 1 addition & 1 deletion compiler/noirc_frontend/src/lexer/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ impl Attributes {
}

pub fn is_varargs(&self) -> bool {
self.secondary.iter().find(|attr| matches!(attr, SecondaryAttribute::Varargs)).is_some()
self.secondary.iter().any(|attr| matches!(attr, SecondaryAttribute::Varargs))
}
}

Expand Down

0 comments on commit 01f93cf

Please sign in to comment.