aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ide_assists/src/handlers/generate_default_from_new.rs6
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;
6use itertools::Itertools; 6use itertools::Itertools;
7use stdx::format_to; 7use stdx::format_to;
8use syntax::{ 8use 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 {