sensible 0.1.0

Configurable derive macro for implementing Default
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![cfg(test)]

use assert2::check;
use sensible::Default;

#[derive(Default)]
struct Foo {
  a: String,
  #[default("foo".into())]
  b: String,
}

#[test]
fn test_strings() {
  let def = Foo::default();
  check!(def.a == "");
  check!(def.b == "foo");
}