Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2a-42 committed Dec 25, 2024
1 parent 5ec869c commit cb2c89e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/c/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ pub fn tokenize(

include!(concat!(env!("OUT_DIR"), "/generated.rs"));

impl<'a> Parser<'a> {
impl Parser<'_> {
fn check_missing_type_specifier(
&self,
decl_specs: Option<DeclarationSpecifiers>,
Expand Down Expand Up @@ -567,7 +567,7 @@ impl<'a> Parser<'a> {
}

#[allow(clippy::ptr_arg)]
impl<'a> PredicatesAndActions for Parser<'a> {
impl PredicatesAndActions for Parser<'_> {
fn build(&mut self, rule: Rule, node: NodeRef, diags: &mut Vec<Diagnostic>) {
match rule {
Rule::Declaration => {
Expand Down
2 changes: 1 addition & 1 deletion examples/l/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub fn tokenize(
(tokens, ranges)
}

impl<'a> PredicatesAndActions for Parser<'a> {
impl PredicatesAndActions for Parser<'_> {
fn predicate_param_list_1(&self) -> bool {
self.peek(1) != Token::RPar
}
Expand Down
6 changes: 4 additions & 2 deletions examples/lua/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ fn parse_comments(lexer: &mut Lexer<'_, Token>) -> Result<(), LexerError> {
}
fn parse_first_line_comment(lexer: &mut Lexer<'_, Token>) -> Token {
if lexer.span().start == 0 {
lexer.remainder().find('\n').map(|i| lexer.bump(i + 1));
if let Some(i) = lexer.remainder().find('\n') {
lexer.bump(i + 1)
}
return Token::FirstLineComment;
}
Token::Hash
Expand Down Expand Up @@ -268,7 +270,7 @@ pub fn tokenize(

include!(concat!(env!("OUT_DIR"), "/generated.rs"));

impl<'a> PredicatesAndActions for Parser<'a> {
impl PredicatesAndActions for Parser<'_> {
fn build(&mut self, rule: Rule, node: NodeRef, diags: &mut Vec<Diagnostic>) {
match rule {
Rule::Expstat => {
Expand Down

0 comments on commit cb2c89e

Please sign in to comment.