2 releases
0.1.1 | Feb 10, 2023 |
---|---|
0.1.0 | Feb 10, 2023 |
#6 in #pino
187 downloads per month
Used in 20 crates
(5 directly)
6KB
118 lines
Example usage
use pino_deref::{Deref, DerefMut};
#[derive(Deref, DerefMut)]
struct Nametag(pub String);
fn main() {
let nametag = Nametag("pinosaur".into());
assert_eq!(*nametag, String::from("pinosaur"));
}
lib.rs
:
Derive macro for Deref and DerefMut
use pino_deref::{Deref, DerefMut};
#[derive(Deref, DerefMut)]
struct Nametag(pub String);
fn main() {
let nametag = Nametag("pinosaur".into());
assert_eq!(*nametag, String::from("pinosaur"));
}
Dependencies
~1.5MB
~38K SLoC