lesurp/OptionalStruct

Add support for :: inside optional_derive

Closed this issue · 1 comments

The following has build failure

#[derive(OptionalStruct)]
#[optional_derive(Debug, Clone, PartialEq, serde::Deserialize)]
struct TestConfig {
delay: Option,
path: String,
percentage: f32,
}

error: proc-macro derive panicked
--> src/main.rs:60:10
|
60 | #[derive(OptionalStruct)]
| ^^^^^^^^^^^^^^
|
= help: message: called Result::unwrap() on an Err value: "failed to parse derive input: "#[optional_derive(Debug, Clone, PartialEq, serde :: Deserialize)] struct\nTestConfig { delay : Option < u32 >, path : String, percentage : f32, }""

While the following is build correctly (however would not work with serde serialization)

#[derive(OptionalStruct)]
#[optional_derive(Debug, Clone, PartialEq, Deserialize)]
struct TestConfig {
delay: Option,
path: String,
percentage: f32,
}

Seems to be fixed by #15 (see test from c4223de).
Now have issues for already existing derive directives...