Skip to content

v1.0.5

Choose a tag to compare

@ImaMapleTree ImaMapleTree released this 09 Jun 14:58
· 2 commits to main since this release
43b0b7e

Changes

Added two new properties for custom constructors

  • into - applies the into property to all non-annotated fields
  • default - applies the default property 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
}