fieldx 0.2.3

Procedural macro for constructing structs with lazily initialized fields, builder pattern, and serde support with a focus on declarative syntax.
Documentation
use fieldx::fxstruct;

#[fxstruct(builder)]
struct Foo<const N: usize = 1> {
    #[fieldx(get, default(N), builder(attributes_fn(allow(unused))))]
    v: usize,
}

#[test]
fn generic_default() {
    let foo: Foo = Foo::builder().build().unwrap();
    assert_eq!(foo.v, 1, "default generic value is 1");
}

#[test]
fn generic_2() {
    let foo = Foo::<2>::builder().build().unwrap();
    assert_eq!(foo.v, 2, "generic value is 2");
}