Skip to content

Commit

Permalink
Optimize with_generics more
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Mar 23, 2023
1 parent b1506cc commit fcf366c
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions crates/swc_macros_common/src/syn_ext.rs
Expand Up @@ -65,7 +65,7 @@ impl ItemImplExt for ItemImpl {
};

ItemImpl {
generics: generics.clone(),
generics,
self_ty: parse2(item).unwrap(),
..self
}
Expand All @@ -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,
Expand Down

0 comments on commit fcf366c

Please sign in to comment.