From b9fc11b18e5367d325b4b8ee41dac2b79c79d7cf Mon Sep 17 00:00:00 2001 From: Bodil Stokke Date: Tue, 1 Oct 2019 15:00:27 +0100 Subject: [PATCH] Clippy appeasement. --- clippy.toml | 2 +- macros/src/error.rs | 7 ++----- macros/src/parser.rs | 3 +++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/clippy.toml b/clippy.toml index d6f2aca..b61f12d 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,5 +1,5 @@ blacklisted-names = [] -cyclomatic-complexity-threshold = 100 +cognitive-complexity-threshold = 100 single-char-binding-names-threshold = 15 # I HAVE THE POWER OF OLEG type-complexity-threshold = 999999 diff --git a/macros/src/error.rs b/macros/src/error.rs index 4bd887c..06afd41 100644 --- a/macros/src/error.rs +++ b/macros/src/error.rs @@ -1,6 +1,6 @@ +use crate::lexer::Token; use ansi_term::Style; use lalrpop_util::ParseError::*; -use crate::lexer::Token; use proc_macro2::{Ident, TokenStream}; use quote::{quote, quote_spanned}; @@ -49,10 +49,7 @@ pub fn parse_error(input: &[Token], error: &ParseError) -> TokenStream { compile_error! { "invalid token" } } } - UnrecognizedEOF { - location: _, - expected, - } => { + UnrecognizedEOF { expected, .. } => { let msg = format!( "unexpected end of macro; missing {}", pprint_tokens(&expected) diff --git a/macros/src/parser.rs b/macros/src/parser.rs index 6b45b06..bc093cd 100644 --- a/macros/src/parser.rs +++ b/macros/src/parser.rs @@ -1,3 +1,6 @@ +// We REALLY don't want to lint the generated parser code. +#![allow(clippy::all)] + use lalrpop_util::lalrpop_mod; lalrpop_mod!(pub grammar);