Browse Source

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 3 years ago
parent
commit
839d2f3d80
Signed by: epilys GPG Key ID: 73627C2F690DF710
  1. 2
      config_macros.rs

2
config_macros.rs

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

Loading…
Cancel
Save