diff --git a/miniconf/tests/enum.rs b/miniconf/tests/enum.rs index 4f94baef..64740e1e 100644 --- a/miniconf/tests/enum.rs +++ b/miniconf/tests/enum.rs @@ -1,4 +1,4 @@ -use miniconf::{JsonCoreSlash, Path, Tree, TreeDeserialize, TreeKey, TreeSerialize}; +use miniconf::{JsonCoreSlash, Path, Tree, TreeKey}; #[test] fn newtype_enums() { @@ -7,7 +7,7 @@ fn newtype_enums() { a: i32, } - #[derive(TreeKey, TreeSerialize, TreeDeserialize, Default)] + #[derive(Tree, Default)] enum Settings { #[default] Unit, diff --git a/miniconf_derive/src/field.rs b/miniconf_derive/src/field.rs index 09539cbd..9b047eb8 100644 --- a/miniconf_derive/src/field.rs +++ b/miniconf_derive/src/field.rs @@ -163,11 +163,11 @@ impl TreeField { if depth > 0 { quote! { #lhs => #getter - .and_then(|value| ::miniconf::TreeAny::<#depth>::ref_any_by_key(value, keys)) + .and_then(|item| ::miniconf::TreeAny::<#depth>::ref_any_by_key(item, keys)) } } else { quote! { - #lhs => #getter.map(|value| value as &dyn ::core::any::Any) + #lhs => #getter.map(|item| item as &dyn ::core::any::Any) } } } @@ -180,11 +180,11 @@ impl TreeField { if depth > 0 { quote! { #lhs => #getter_mut - .and_then(|value| ::miniconf::TreeAny::<#depth>::mut_any_by_key(value, keys)) + .and_then(|item| ::miniconf::TreeAny::<#depth>::mut_any_by_key(item, keys)) } } else { quote! { - #lhs => #getter_mut.map(|value| value as &mut dyn ::core::any::Any) + #lhs => #getter_mut.map(|item| item as &mut dyn ::core::any::Any) } } } diff --git a/miniconf_derive/src/tree.rs b/miniconf_derive/src/tree.rs index 3c8ba335..4c4e6851 100644 --- a/miniconf_derive/src/tree.rs +++ b/miniconf_derive/src/tree.rs @@ -447,7 +447,7 @@ impl Tree { // Note(unreachable) empty structs have diverged by now #[allow(unreachable_code)] { - let ret: Result<_, _> = match index { + let ret: Result<_, _> = match #mat { #(#mut_arms ,)* _ => #default };