2个版本

0.1.1 2023年2月10日
0.1.0 2023年2月10日

#10#deref-mut

Download history 65/week @ 2024-04-08 94/week @ 2024-04-15 64/week @ 2024-04-22 58/week @ 2024-04-29 52/week @ 2024-05-06 74/week @ 2024-05-13 64/week @ 2024-05-20 124/week @ 2024-05-27 64/week @ 2024-06-03 78/week @ 2024-06-10 74/week @ 2024-06-17 96/week @ 2024-06-24 45/week @ 2024-07-08 79/week @ 2024-07-15 51/week @ 2024-07-22

191 每月下载量
用于 20 个crate(5 直接使用)

MIT/Apache

6KB
118

pino_deref

Deref和DerefMut派生宏

crates.io docs.rs MIT/Apache 2.0

示例用法

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:

Deref和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"));
}

依赖项

~1.5MB
~35K SLoC