mod foo { use feluments::Builder; #[derive(Debug, PartialEq, Eq, Builder)] #[allow(dead_code)] #[builder(name = "FooBuild", makro)] pub struct Foo { #[builder(into, vis = pub)] pub bar: String, #[builder(default = 32)] pub baz: i32, #[builder(default = baz * 2)] pub bat: i32, } } use foo::Foo; fn main() { let x = Foo::builder().baz(42).bar("hello").bat(5).build(); assert_eq!( x, Foo { bar: "hello".into(), baz: 42, bat: 5 } ); let bar = "hello"; let _: Foo = Foo! { bar }; assert_eq!( x, Foo { bar: "hello".into(), baz: 32, bat: 64 } ); }