better_default 1.0.5

The std Default derive, but it allows to constomize the default fields values and has some upgrades.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#![allow(dead_code)]

use better_default::Default;

#[derive(Default, Debug)]
// here we can use the top default attribute to customize the default values of our fields.
//      - we change the default value of the first field (represented by the index 0) to 1
#[default(0: 1)]
struct Struct(u32, String);

fn main() {
    let default = Struct::default();
    println!("{:?}", default) // should print "Struct(1, "")"
}