derive-ctor 0.2.2

Adds `#[derive(ctor)]` which allows for the auto-generation of a constructor.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::marker::PhantomData;
use derive_ctor::ctor;

#[derive(ctor, Debug, PartialEq)]
struct HasPhantomData {
    value: u32,
    _marker: PhantomData<u32>
}

#[test]
fn test_phantom_data_auto_excluded_as_parameter() {
    let pd = HasPhantomData::new(4);
    assert_eq!(HasPhantomData { value: 4, _marker: PhantomData }, pd)
}