From 839d2f3d80ef8ed35df4bc4c3c1cdf635aca3abe Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Wed, 8 Jul 2020 12:04:53 +0300 Subject: [PATCH] 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. --- config_macros.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);