From f5ea2a2ab0df1a8ccf9f20d97ca07f9169e70c79 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Sat, 15 May 2021 21:12:06 +0800 Subject: Remove attrs --- crates/ide_assists/src/handlers/generate_default_from_new.rs | 6 +----- 1 file changed, 1 insertion(+), 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; use itertools::Itertools; use stdx::format_to; use syntax::{ - ast::{self, AttrsOwner, GenericParamsOwner, Impl, NameOwner, TypeBoundsOwner}, + ast::{self, GenericParamsOwner, Impl, NameOwner, TypeBoundsOwner}, AstNode, }; @@ -80,10 +80,6 @@ fn generate_trait_impl_text_from_impl(impl_: &ast::Impl, trait_text: &str, code: let generic_params = impl_.generic_param_list(); let mut buf = String::with_capacity(code.len()); buf.push_str("\n\n"); - impl_ - .attrs() - .filter(|attr| attr.as_simple_call().map(|(name, _arg)| name == "cfg").unwrap_or(false)) - .for_each(|attr| buf.push_str(format!("{}\n", attr.to_string()).as_str())); buf.push_str("impl"); if let Some(generic_params) = &generic_params { -- cgit v1.2.3