diff options
Diffstat (limited to 'src/args.rs')
-rw-r--r-- | src/args.rs | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/args.rs b/src/args.rs index 758af8c..3936738 100644 --- a/src/args.rs +++ b/src/args.rs @@ -58,39 +58,14 @@ impl From<DeviceModel> for nitrokey::Model { } } -impl<'de> serde::Deserialize<'de> for DeviceModel { - fn deserialize<D>(deserializer: D) -> Result<DeviceModel, D::Error> - where - D: serde::Deserializer<'de>, - { - use serde::de::Error as _; - use std::str::FromStr as _; - - let s = String::deserialize(deserializer)?; - DeviceModel::from_str(&s).map_err(D::Error::custom) - } -} - Enum! { /// The format for the nitrocli output. OutputFormat, [ + Json => "json", Text => "text", ] } -impl<'de> serde::Deserialize<'de> for OutputFormat { - fn deserialize<D>(deserializer: D) -> Result<OutputFormat, D::Error> - where - D: serde::Deserializer<'de>, - { - use serde::de::Error as _; - use std::str::FromStr as _; - - let s = String::deserialize(deserializer)?; - OutputFormat::from_str(&s).map_err(D::Error::custom) - } -} - Command! { /// A top-level command for nitrocli. Command, [ |