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
10
use ref_cast::ref_cast_custom;
use ref_cast_test_suite::Struct;

#[ref_cast_custom]
fn ref_cast(s: &str) -> &Struct;

#[ref_cast_custom]
fn ref_cast_mut(s: &mut str) -> &mut Struct;

fn main() {}