lesurp / OptionalStruct

Macro copying a struct with Option fields. Useful for config initialization
Apache License 2.0
36 stars 12 forks source link

Check if field is already an Option<T> #2

Closed lesurp closed 6 years ago

lesurp commented 6 years ago
struct Config {
    timeout: Option<u32>,
}

We don't want to generate an Option<Option<u32>> in the resulting struct ; we should check for Option fields