remove conflicting default impl

This commit is contained in:
Max Känner 2024-08-18 17:37:53 +02:00
parent 3d95c32d93
commit d4fdc2d642
2 changed files with 9 additions and 0 deletions

View File

@ -50,6 +50,7 @@ impl ConfigField {
derive.contains("Tree") derive.contains("Tree")
|| derive.contains("Serialize") || derive.contains("Serialize")
|| derive.contains("Deserialize") || derive.contains("Deserialize")
|| (self.default.is_some() && derive.contains("Default"))
}) == Some(false) }) == Some(false)
}); });
quote! {#[derive(#(#derives,)*)]} quote! {#[derive(#(#derives,)*)]}

View File

@ -31,6 +31,14 @@ struct Config {
sub_config: SubConfig, sub_config: SubConfig,
} }
/// Config with default derive and default field
#[config]
#[derive(Default)]
struct _DefaultConfig {
#[config(default)]
field: i32,
}
#[rstest] #[rstest]
#[case(0, ["skipped"])] #[case(0, ["skipped"])]
#[case(1, ["min"])] #[case(1, ["min"])]