mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor(ast): use type identifier instead of CloneIn::Cloned GAT. (#4738)
After https://github.com/oxc-project/oxc/pull/4731#discussion_r1707526289, I realized that I'm using `Self::Cloned` for enum derives. It was from my earlier attempts to resolve lifetime issues.
This commit is contained in:
parent
51c1ca02d3
commit
579b797cc5
2 changed files with 800 additions and 662 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -59,10 +59,10 @@ fn derive_enum(def: &EnumDef) -> TokenStream {
|
||||||
.map(|var| {
|
.map(|var| {
|
||||||
let ident = var.ident();
|
let ident = var.ident();
|
||||||
if var.is_unit() {
|
if var.is_unit() {
|
||||||
quote!(Self :: #ident => Self :: Cloned :: #ident)
|
quote!(Self :: #ident => #ty_ident :: #ident)
|
||||||
} else {
|
} else {
|
||||||
used_alloc = true;
|
used_alloc = true;
|
||||||
quote!(Self :: #ident(it) => Self :: Cloned :: #ident(it.clone_in(alloc)))
|
quote!(Self :: #ident(it) => #ty_ident :: #ident(it.clone_in(alloc)))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect_vec();
|
.collect_vec();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue