diff options
author | Kirill Bulatov <[email protected]> | 2020-02-18 12:53:02 +0000 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2020-02-18 14:03:08 +0000 |
commit | b8ddcb0652f3ec8683023afc1e1f5166d6a712f4 (patch) | |
tree | ea95a1e2083280d84e99f274e5b2b8b269545297 /crates/ra_hir_expand | |
parent | eab80cd961919b9321e1d34343ae3f3adb0502e5 (diff) |
Run cargo +nightly fix --clippy -Z unstable-options
Diffstat (limited to 'crates/ra_hir_expand')
-rw-r--r-- | crates/ra_hir_expand/src/builtin_derive.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_expand/src/builtin_macro.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_expand/src/quote.rs | 3 |
3 files changed, 4 insertions, 5 deletions
diff --git a/crates/ra_hir_expand/src/builtin_derive.rs b/crates/ra_hir_expand/src/builtin_derive.rs index 62c60e336..d0e3eaf7e 100644 --- a/crates/ra_hir_expand/src/builtin_derive.rs +++ b/crates/ra_hir_expand/src/builtin_derive.rs | |||
@@ -235,7 +235,7 @@ mod tests { | |||
235 | let (db, file_id) = TestDB::with_single_file(&s); | 235 | let (db, file_id) = TestDB::with_single_file(&s); |
236 | let parsed = db.parse(file_id); | 236 | let parsed = db.parse(file_id); |
237 | let items: Vec<_> = | 237 | let items: Vec<_> = |
238 | parsed.syntax_node().descendants().filter_map(|it| ast::ModuleItem::cast(it)).collect(); | 238 | parsed.syntax_node().descendants().filter_map(ast::ModuleItem::cast).collect(); |
239 | 239 | ||
240 | let ast_id_map = db.ast_id_map(file_id.into()); | 240 | let ast_id_map = db.ast_id_map(file_id.into()); |
241 | 241 | ||
diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs index f3f959ac6..4adaa9b07 100644 --- a/crates/ra_hir_expand/src/builtin_macro.rs +++ b/crates/ra_hir_expand/src/builtin_macro.rs | |||
@@ -158,7 +158,7 @@ fn compile_error_expand( | |||
158 | match &tt.token_trees[0] { | 158 | match &tt.token_trees[0] { |
159 | tt::TokenTree::Leaf(tt::Leaf::Literal(it)) => { | 159 | tt::TokenTree::Leaf(tt::Leaf::Literal(it)) => { |
160 | let s = it.text.as_str(); | 160 | let s = it.text.as_str(); |
161 | if s.contains(r#"""#) { | 161 | if s.contains('"') { |
162 | return Ok(quote! { loop { #it }}); | 162 | return Ok(quote! { loop { #it }}); |
163 | } | 163 | } |
164 | } | 164 | } |
@@ -222,7 +222,7 @@ mod tests { | |||
222 | let (db, file_id) = TestDB::with_single_file(&s); | 222 | let (db, file_id) = TestDB::with_single_file(&s); |
223 | let parsed = db.parse(file_id); | 223 | let parsed = db.parse(file_id); |
224 | let macro_calls: Vec<_> = | 224 | let macro_calls: Vec<_> = |
225 | parsed.syntax_node().descendants().filter_map(|it| ast::MacroCall::cast(it)).collect(); | 225 | parsed.syntax_node().descendants().filter_map(ast::MacroCall::cast).collect(); |
226 | 226 | ||
227 | let ast_id_map = db.ast_id_map(file_id.into()); | 227 | let ast_id_map = db.ast_id_map(file_id.into()); |
228 | 228 | ||
diff --git a/crates/ra_hir_expand/src/quote.rs b/crates/ra_hir_expand/src/quote.rs index 4de219ce4..b54e00b68 100644 --- a/crates/ra_hir_expand/src/quote.rs +++ b/crates/ra_hir_expand/src/quote.rs | |||
@@ -259,8 +259,7 @@ mod tests { | |||
259 | // } | 259 | // } |
260 | let struct_name = mk_ident("Foo"); | 260 | let struct_name = mk_ident("Foo"); |
261 | let fields = [mk_ident("name"), mk_ident("id")]; | 261 | let fields = [mk_ident("name"), mk_ident("id")]; |
262 | let fields = | 262 | let fields = fields.iter().map(|it| quote!(#it: self.#it.clone(), ).token_trees).flatten(); |
263 | fields.iter().map(|it| quote!(#it: self.#it.clone(), ).token_trees.clone()).flatten(); | ||
264 | 263 | ||
265 | let list = tt::Subtree { | 264 | let list = tt::Subtree { |
266 | delimiter: Some(tt::Delimiter { | 265 | delimiter: Some(tt::Delimiter { |