From 966c23f5290275ce17564f6027a17ec20cd6078f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 17 Mar 2021 01:27:56 +0100 Subject: avoid converting types into themselves via .into() (clippy::useless-conversion) example: let x: String = String::from("hello world").into(); --- crates/mbe/src/benchmark.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'crates/mbe/src/benchmark.rs') diff --git a/crates/mbe/src/benchmark.rs b/crates/mbe/src/benchmark.rs index 503ad1355..bd8ea6452 100644 --- a/crates/mbe/src/benchmark.rs +++ b/crates/mbe/src/benchmark.rs @@ -120,7 +120,7 @@ fn invocation_fixtures(rules: &FxHashMap) -> Vec<(String, tt Some("pat") => parent.token_trees.push(make_ident("foo")), Some("path") => parent.token_trees.push(make_ident("foo")), Some("literal") => parent.token_trees.push(make_literal("1")), - Some("expr") => parent.token_trees.push(make_ident("foo").into()), + Some("expr") => parent.token_trees.push(make_ident("foo")), Some("lifetime") => { parent.token_trees.push(make_punct('\'')); parent.token_trees.push(make_ident("a")); @@ -157,17 +157,15 @@ fn invocation_fixtures(rules: &FxHashMap) -> Vec<(String, tt if i + 1 != cnt { if let Some(sep) = separator { match sep { - Separator::Literal(it) => parent - .token_trees - .push(tt::Leaf::Literal(it.clone().into()).into()), - Separator::Ident(it) => parent - .token_trees - .push(tt::Leaf::Ident(it.clone().into()).into()), + Separator::Literal(it) => { + parent.token_trees.push(tt::Leaf::Literal(it.clone()).into()) + } + Separator::Ident(it) => { + parent.token_trees.push(tt::Leaf::Ident(it.clone()).into()) + } Separator::Puncts(puncts) => { for it in puncts { - parent - .token_trees - .push(tt::Leaf::Punct(it.clone().into()).into()) + parent.token_trees.push(tt::Leaf::Punct(it.clone()).into()) } } }; -- cgit v1.2.3