Crates.io | serde-clap-deserialize |
lib.rs | serde-clap-deserialize |
version | 0.1.0 |
source | src |
created_at | 2024-03-14 23:41:08.853796 |
updated_at | 2024-03-14 23:41:08.853796 |
description | Proc macro for setting serde/clap defaults |
homepage | |
repository | https://github.com/voximity/serde-clap-deserialize |
max_upload_size | |
id | 1174259 |
size | 5,106 |
Small proc macro to add both default values to clap and serde. Inspired by serde-inline-default.
#[serde_clap_deserialize]
#[derive(Deserialize, Parser)]
struct MyArgs {
#[serde_clap_deserialize(8)]
foo: u32,
}
// MyArgs can now be serde-deserialized or clap-parsed
// and `foo` will have a default value of 8