From eb416cc02b1ec8dbd3073dc6e2c0f80ae53dab9e Mon Sep 17 00:00:00 2001 From: Philipp A Date: Fri, 7 Dec 2018 23:12:00 +0100 Subject: fix clippy --- src/document_tree/element_categories.rs | 10 +++++----- src/parser/pest_rst.rs | 2 ++ src/parser/tests.rs | 3 +++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/document_tree/element_categories.rs b/src/document_tree/element_categories.rs index b4d63a2..ec53f09 100644 --- a/src/document_tree/element_categories.rs +++ b/src/document_tree/element_categories.rs @@ -27,7 +27,7 @@ macro_rules! impl_into { ($subcat:ident :: $entry:ident => $supcat:ident ) => { impl Into<$supcat> for $entry { fn into(self) -> $supcat { - $supcat::$subcat(self.into()) + $supcat::$subcat(Box::new(self.into())) } } }; @@ -44,9 +44,9 @@ macro_rules! synonymous_enum { }; ( $name:ident { $( $entry:ident ),+ $(,)* } ) => { #[derive(Serialize)] - pub enum $name { - $( $entry($entry), )* - } + pub enum $name { $( + $entry(Box<$entry>), + )* } impl Debug for $name { fn fmt(&self, fmt: &mut Formatter) -> Result<(), fmt::Error> { @@ -58,7 +58,7 @@ macro_rules! synonymous_enum { $( impl Into<$name> for $entry { fn into(self) -> $name { - $name::$entry(self) + $name::$entry(Box::new(self)) } } )* }; diff --git a/src/parser/pest_rst.rs b/src/parser/pest_rst.rs index 8c36fc1..74199a8 100644 --- a/src/parser/pest_rst.rs +++ b/src/parser/pest_rst.rs @@ -1,3 +1,5 @@ +#![allow(clippy::redundant_closure)] + use pest_derive::Parser; #[derive(Parser)] diff --git a/src/parser/tests.rs b/src/parser/tests.rs index 7c5c114..331f87b 100644 --- a/src/parser/tests.rs +++ b/src/parser/tests.rs @@ -53,6 +53,7 @@ Title }; } +#[allow(clippy::cyclomatic_complexity)] #[test] fn two_targets() { parses_to! { @@ -75,6 +76,7 @@ fn two_targets() { }; } +#[allow(clippy::cyclomatic_complexity)] #[test] fn admonitions() { parses_to! { @@ -109,6 +111,7 @@ fn admonitions() { // TODO: substitutions // TODO: images +#[allow(clippy::cyclomatic_complexity)] #[test] fn nested_lists() { parses_to! { -- cgit v1.2.3