Could you review this simple usage of
std::mem::transmute (lifetime extension): playground (commented)?
From the docs:
transmuteis incredibly unsafe. There are a vast number of ways to cause undefined behavior with this function.
transmuteshould be the absolute last resort.
There are a few things that
transmuteis really useful for. [...] Extending a lifetime, or shortening an invariant lifetime. This is advanced, very unsafe Rust!
^ Yep this is what we are doing!
Thank you all!