From fcf366ccec0c1b97b09745ef840e95319ebaf6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Thu, 23 Mar 2023 17:22:07 +0900 Subject: [PATCH] Optimize `with_generics` more --- crates/swc_macros_common/src/syn_ext.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/crates/swc_macros_common/src/syn_ext.rs b/crates/swc_macros_common/src/syn_ext.rs index b4e612432ad1..fb58d3f40c19 100644 --- a/crates/swc_macros_common/src/syn_ext.rs +++ b/crates/swc_macros_common/src/syn_ext.rs @@ -65,7 +65,7 @@ impl ItemImplExt for ItemImpl { }; ItemImpl { - generics: generics.clone(), + generics, self_ty: parse2(item).unwrap(), ..self } @@ -75,17 +75,6 @@ impl ItemImplExt for ItemImpl { item.generics .params .extend(self.generics.params.into_pairs()); - match self.generics.where_clause { - Some(WhereClause { - ref mut predicates, .. - }) => predicates.extend( - generics - .where_clause - .into_iter() - .flat_map(|wc| wc.predicates.into_pairs()), - ), - ref mut opt @ None => *opt = generics.where_clause, - } ItemImpl { defaultness: self.defaultness,