Repository navigation
v1.0.5
Changes
Added two new properties for custom constructors
- into - applies the
intoproperty to all non-annotated fields - default - applies the
defaultproperty to all non-annotated fields
Here's an example of how to apply these properties:
use derive_ctor::ctor;
#[derive(ctor)]
#[ctor(pub new(into), with_defaults(default)]
struct MyStruct {
name: String,
#[ctor(expr(100))]
gold: i32
}