Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 629 Bytes

README.md

File metadata and controls

33 lines (24 loc) · 629 Bytes

derive-vec

Simply a learning avenue for proc-macros...

CI


Derive Vec like behavior for a struct with an inner Vec.

Example

use derive_vec::{VecBehavior, VecTrait};

#[derive(VecBehavior, Default)]
struct Foo {
    #[vec]
    pub values: Vec<usize>,
}

fn main() {
    let mut foo = Foo::default();
    foo.push(1);
    assert_eq!(foo.values.len(), 1);
}

Status:

  • Support for non-generic structs
  • Support for generic structs