TIL if you have an enum Foo { Bar(T), Baz(T) } you can impl Deref w/ Target = T for Foo and then treat &Foo as a T, ridding yourself of silly stuff like match foo { Bar(x) => do_thing(x), Baz(x) => do_thing(x) } and instead use do_thing(*x)
-
-
sure thing thx for the tip
-
they can take my deref conversions when they pry them from my cold dead hands
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.