#[derive(Deref)]
Expand description
Implements Deref
for single-item structs. This is especially useful when
utilizing the newtype pattern.
If you need DerefMut
as well, consider using the other derive macro alongside
this one.
Example
use bevy_derive::Deref;
#[derive(Deref)]
struct MyNewtype(String);
let foo = MyNewtype(String::from("Hello"));
assert_eq!(5, foo.len());