diff options
author | Matthias Krüger <[email protected]> | 2021-03-17 00:27:56 +0000 |
---|---|---|
committer | Matthias Krüger <[email protected]> | 2021-03-17 00:27:56 +0000 |
commit | 966c23f5290275ce17564f6027a17ec20cd6078f (patch) | |
tree | 9e977a29eaf10d1733340563ef31fda064e37400 /crates/mbe/src/benchmark.rs | |
parent | 83e6940efb42675226adb8d2856c095b8dce36c5 (diff) |
avoid converting types into themselves via .into() (clippy::useless-conversion)
example: let x: String = String::from("hello world").into();
Diffstat (limited to 'crates/mbe/src/benchmark.rs')
-rw-r--r-- | crates/mbe/src/benchmark.rs | 18 |
1 files changed, 8 insertions, 10 deletions
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<String, MacroRules>) -> Vec<(String, tt | |||
120 | Some("pat") => parent.token_trees.push(make_ident("foo")), | 120 | Some("pat") => parent.token_trees.push(make_ident("foo")), |
121 | Some("path") => parent.token_trees.push(make_ident("foo")), | 121 | Some("path") => parent.token_trees.push(make_ident("foo")), |
122 | Some("literal") => parent.token_trees.push(make_literal("1")), | 122 | Some("literal") => parent.token_trees.push(make_literal("1")), |
123 | Some("expr") => parent.token_trees.push(make_ident("foo").into()), | 123 | Some("expr") => parent.token_trees.push(make_ident("foo")), |
124 | Some("lifetime") => { | 124 | Some("lifetime") => { |
125 | parent.token_trees.push(make_punct('\'')); | 125 | parent.token_trees.push(make_punct('\'')); |
126 | parent.token_trees.push(make_ident("a")); | 126 | parent.token_trees.push(make_ident("a")); |
@@ -157,17 +157,15 @@ fn invocation_fixtures(rules: &FxHashMap<String, MacroRules>) -> Vec<(String, tt | |||
157 | if i + 1 != cnt { | 157 | if i + 1 != cnt { |
158 | if let Some(sep) = separator { | 158 | if let Some(sep) = separator { |
159 | match sep { | 159 | match sep { |
160 | Separator::Literal(it) => parent | 160 | Separator::Literal(it) => { |
161 | .token_trees | 161 | parent.token_trees.push(tt::Leaf::Literal(it.clone()).into()) |
162 | .push(tt::Leaf::Literal(it.clone().into()).into()), | 162 | } |
163 | Separator::Ident(it) => parent | 163 | Separator::Ident(it) => { |
164 | .token_trees | 164 | parent.token_trees.push(tt::Leaf::Ident(it.clone()).into()) |
165 | .push(tt::Leaf::Ident(it.clone().into()).into()), | 165 | } |
166 | Separator::Puncts(puncts) => { | 166 | Separator::Puncts(puncts) => { |
167 | for it in puncts { | 167 | for it in puncts { |
168 | parent | 168 | parent.token_trees.push(tt::Leaf::Punct(it.clone()).into()) |
169 | .token_trees | ||
170 | .push(tt::Leaf::Punct(it.clone().into()).into()) | ||
171 | } | 169 | } |
172 | } | 170 | } |
173 | }; | 171 | }; |