Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
0e59545f92 | |||
d4fdc2d642 |
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "macroconf"
|
name = "macroconf"
|
||||||
version = "0.3.1"
|
version = "0.3.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "macro for creating configurations using miniconf"
|
description = "macro for creating configurations using miniconf"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
@ -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,)*)]}
|
||||||
|
@ -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"])]
|
||||||
|
Reference in New Issue
Block a user