darling
darling copied to clipboard
WithOriginal and UsesTypeParams/UsesLifetimes
I had a data that looked like this:
data: ast::Data<darling::util::Ignored, MyField>,
and I implemented UsesTypeParams and UsesLifetimes for MyField, so I could use data.uses_type_params_cloned and everything was great.
Then I needed access to the original syn::Field, so I found WithOriginal, and changed my data to this:
data: ast::Data<darling::util::Ignored, WithOriginal<MyField, syn::Field>>,
but this broke data.uses_type_params_cloned (and uses_lifetimes_cloned) because WithOriginal does not implement these two traits.
Wouldn't it make sense for WithOriginal to forward these traits to the parsed type?
Yes, that sounds reasonable to me.