Skip to content

Commit

Permalink
use bool::then
Browse files Browse the repository at this point in the history
  • Loading branch information
asterite committed Oct 30, 2024
1 parent 42911a7 commit ab4c994
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions compiler/noirc_frontend/src/parser/parser/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,15 +548,13 @@ impl<'a> Parser<'a> {
Ident::new(String::new(), self.span_at_previous_token_end())
};

let turbofish = if self.eat_double_colon() {
let turbofish = self.eat_double_colon().then(|| {
let generics = self.parse_generic_type_args();
if generics.is_empty() {
self.expected_token(Token::Less);
}
Some(generics)
} else {
None
};
generics
});

Some(ExpressionKind::TypePath(TypePath { typ, item, turbofish }))
}
Expand Down

0 comments on commit ab4c994

Please sign in to comment.