config_macros.rs: don't skip nonmatching attributes

config_macros.rs contains a macro that parses config structs and
generates a new "override" struct that contains the fields as Options.
The macro matches on each field's attributes and removes the serde
"default" attributes, since the override default is always None.
However, if an attribute contained a group of values and the first
wasn't `default` the attribute was skipped, so don't do that.
This commit is contained in:
Manos Pitsidianakis 2020-07-08 12:04:53 +03:00
parent bfc08f892d
commit 839d2f3d80
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710

View File

@ -102,7 +102,7 @@ use super::*;
if !attr_inner_value.starts_with("( default")
&& !attr_inner_value.starts_with("( default =")
{
return None;
return Some(new_attr);
}
if attr_inner_value.starts_with("( default =") {
let rest = g.stream().clone().into_iter().skip(4);