ref-cast 1.0.25

Safely cast &T to &U where the struct U contains a single field of type T.
Documentation
1
2
3
4
5
6
7
8
9
use ref_cast::RefCast;

#[derive(RefCast)]
#[repr(align(2), C, align = "2")]
struct Test {
    s: String,
}

fn main() {}