diff options
author | hi-rustin <[email protected]> | 2021-05-15 14:12:06 +0100 |
---|---|---|
committer | hi-rustin <[email protected]> | 2021-05-15 14:12:06 +0100 |
commit | f5ea2a2ab0df1a8ccf9f20d97ca07f9169e70c79 (patch) | |
tree | d4e87a4f8e71c295337daa79f0a1fe6059f60446 /crates/ide_assists/src | |
parent | 696a8bf870ba7df15e54ebabbc72813c93f8d279 (diff) |
Remove attrs
Diffstat (limited to 'crates/ide_assists/src')
-rw-r--r-- | crates/ide_assists/src/handlers/generate_default_from_new.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/crates/ide_assists/src/handlers/generate_default_from_new.rs b/crates/ide_assists/src/handlers/generate_default_from_new.rs index f301932ad..bad826366 100644 --- a/crates/ide_assists/src/handlers/generate_default_from_new.rs +++ b/crates/ide_assists/src/handlers/generate_default_from_new.rs | |||
@@ -6,7 +6,7 @@ use ide_db::helpers::FamousDefs; | |||
6 | use itertools::Itertools; | 6 | use itertools::Itertools; |
7 | use stdx::format_to; | 7 | use stdx::format_to; |
8 | use syntax::{ | 8 | use syntax::{ |
9 | ast::{self, AttrsOwner, GenericParamsOwner, Impl, NameOwner, TypeBoundsOwner}, | 9 | ast::{self, GenericParamsOwner, Impl, NameOwner, TypeBoundsOwner}, |
10 | AstNode, | 10 | AstNode, |
11 | }; | 11 | }; |
12 | 12 | ||
@@ -80,10 +80,6 @@ fn generate_trait_impl_text_from_impl(impl_: &ast::Impl, trait_text: &str, code: | |||
80 | let generic_params = impl_.generic_param_list(); | 80 | let generic_params = impl_.generic_param_list(); |
81 | let mut buf = String::with_capacity(code.len()); | 81 | let mut buf = String::with_capacity(code.len()); |
82 | buf.push_str("\n\n"); | 82 | buf.push_str("\n\n"); |
83 | impl_ | ||
84 | .attrs() | ||
85 | .filter(|attr| attr.as_simple_call().map(|(name, _arg)| name == "cfg").unwrap_or(false)) | ||
86 | .for_each(|attr| buf.push_str(format!("{}\n", attr.to_string()).as_str())); | ||
87 | buf.push_str("impl"); | 83 | buf.push_str("impl"); |
88 | 84 | ||
89 | if let Some(generic_params) = &generic_params { | 85 | if let Some(generic_params) = &generic_params { |