summaryrefslogtreecommitdiffstats
path: root/config_macros.rs
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2020-07-08 12:04:53 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2020-07-08 12:10:14 +0300
commit839d2f3d80ef8ed35df4bc4c3c1cdf635aca3abe (patch)
tree6fa0c485a0e199e2d1f5e681450481712c9c1fc5 /config_macros.rs
parentbfc08f892d07d3a226b4c23766c2920e5e3abd8d (diff)
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.
Diffstat (limited to 'config_macros.rs')
-rw-r--r--config_macros.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/config_macros.rs b/config_macros.rs
index 7e1cf49d..18e9fdad 100644
--- a/config_macros.rs
+++ b/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);