diff --git a/miniconf_derive/src/tree.rs b/miniconf_derive/src/tree.rs index c4b9f9de..7c200f81 100644 --- a/miniconf_derive/src/tree.rs +++ b/miniconf_derive/src/tree.rs @@ -166,7 +166,7 @@ impl Tree { let (names, name_to_index, index_to_name, index_len) = if let Some(names) = names { ( Some(quote!( - const __MINICONF_NAMES: &'static [&'static str] = &[#(#names ,)*]; + const __MINICONF_NAMES: [&'static str; #fields_len] = [#(#names ,)*]; )), quote!(Self::__MINICONF_NAMES.iter().position(|&n| n == value)), quote!(Some(