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.
memfd
Manos Pitsidianakis 2020-07-08 12:04:53 +03:00
parent bfc08f892d
commit 839d2f3d80
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 1 additions and 1 deletions

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);