From 8a34d0832e929c39a7171375a965b007c186b34d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Gonz=C3=A1lez?= Date: Mon, 23 Oct 2023 11:12:48 +0200 Subject: [PATCH] chore: silence a new Clippy lint, run `cargo fmt` --- lang-quote/src/tokenize.rs | 5 +---- lang/src/parse.rs | 1 + lang/src/parse/builder.rs | 3 +++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lang-quote/src/tokenize.rs b/lang-quote/src/tokenize.rs index c63613076..812b5478b 100644 --- a/lang-quote/src/tokenize.rs +++ b/lang-quote/src/tokenize.rs @@ -1521,10 +1521,7 @@ fn tokenize_jump_statement(j: &ast::JumpStatement) -> TokenStream { ast::JumpStatementData::Break => quote! { glsl_lang::ast::JumpStatementData::Break }, ast::JumpStatementData::Discard => quote! { glsl_lang::ast::JumpStatementData::Discard }, ast::JumpStatementData::Return(ref e) => { - let e = e - .as_ref() - .map(|e| (&tokenize_expr(e)).quote()) - .quote(); + let e = e.as_ref().map(|e| (&tokenize_expr(e)).quote()).quote(); quote! { glsl_lang::ast::JumpStatementData::Return(#e) } } }; diff --git a/lang/src/parse.rs b/lang/src/parse.rs index 1a1ef54f2..e74b87631 100644 --- a/lang/src/parse.rs +++ b/lang/src/parse.rs @@ -45,6 +45,7 @@ pub trait HasParser: Sized { } /// GLSL language parsing functions +#[allow(clippy::result_large_err)] pub trait Parse: HasParser { /// Parse the input source fn parse<'i, L: LangLexer<'i>>( diff --git a/lang/src/parse/builder.rs b/lang/src/parse/builder.rs index caddf5b54..24951e74e 100644 --- a/lang/src/parse/builder.rs +++ b/lang/src/parse/builder.rs @@ -50,6 +50,7 @@ impl<'i, 'o, 'c, 'p, L: LangLexer<'i>, T: HasParser> ParseBuilder<'i, 'o, 'c, 'p } /// Execute the parsing operation + #[allow(clippy::result_large_err)] fn parse_source( source: L::Input, opts: Option<&'o ParseOptions>, @@ -93,6 +94,7 @@ impl<'i, 'o, 'c, 'p, L: LangLexer<'i>, T: HasParser> ParseBuilder<'i, 'o, 'c, 'p } /// Execute the parsing operation + #[allow(clippy::result_large_err)] pub fn parse(self) -> ParseResult::Error, T> { Self::parse_source( self.source, @@ -104,6 +106,7 @@ impl<'i, 'o, 'c, 'p, L: LangLexer<'i>, T: HasParser> ParseBuilder<'i, 'o, 'c, 'p } /// Execute the parsing operation, and extract the wanted node + #[allow(clippy::result_large_err)] pub fn extract>( self, ) -> ParseResult::Error, Option> {