Closed kaleidawave closed 2 years ago
Please make sure it builds.
apologies was doing quickly using github.dev of which unfortunately doesn't have rust-analyzer built in, thought workflows were eagerly enabled and would catch. Have fixed syntax, so should be okay.
Ooof, have fixed the guard and formatting. The tests pass locally now. This should be equivalent to the derived implementation on enum X<'a, T> { Owned(T), Reference(&'a T) }
although it skips the branch with the reference variant as the implementation of Trace for references is already empty (could call it but that empty implementation isn't going to change so didn't see the point).
The use case is I have a struct X<'a>(Cow<'a, Y>)
. Most of the time I am only dealing with it as a reference but sometimes I need it for later and store a X<'static>
in a object which can be cyclic under Y
thus needing to doing the trace on the owned data.
Added trace and finalize implementation for
std::borrow::Cow
. I think I have done this correctly, where it only marks if it is the owned variant. Not particularly sure