3 ms·
(Ab)using Rust traits to write silly things
- metadat 4y agoThe explanations are so good! Awesome resource for a non-expert. I do wish the author had an explanation elucidating this one unresolved straggler: > pub use imp::reexport_hack::*; is a glob reexport that reexports Type::Type that was reexported by reexport_hack. I’m not entirely sure why, but using glob is important. > And now the magic: Type now refers both to the type and to the variant. This works because rust has different namespaces for types and values. Glob reexport somehow suppresses an error about clashing names that arises when importing directly. Idk why it’s this way :shrug: