delegate-attr 0.3.0

Attribute proc-macro to delegate method to a field
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use delegate_attr::delegate;

struct Foo(Vec<u8>);

#[delegate(self.0)]
impl Foo {
    fn len(&self) -> usize {}
}

fn main() {
    let foo = Foo(vec![1]);
    assert_eq!(foo.len(), 1);
}