diff options
Diffstat (limited to 'sq/src/commands/revoke.rs')
-rw-r--r-- | sq/src/commands/revoke.rs | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/sq/src/commands/revoke.rs b/sq/src/commands/revoke.rs index 7295d8d5..fd2dd837 100644 --- a/sq/src/commands/revoke.rs +++ b/sq/src/commands/revoke.rs @@ -20,7 +20,6 @@ use crate::{ Config, load_certs, open_or_stdin, - parse_iso8601, }; const NP: &NullPolicy = &NullPolicy::new(); @@ -80,14 +79,7 @@ pub fn revoke_certificate(config: Config, c: RevokeCertificateCommand) -> Result } let secret = secret.into_iter().next(); - // TODO use CliTime - let time = if let Some(time) = c.time { - Some(parse_iso8601(&time, chrono::NaiveTime::from_hms(0, 0, 0)) - .context(format!("Bad value passed to --time: {:?}", - time))?.into()) - } else { - None - }; + let time = c.time.map(|t| t.time.into()); // Each --notation takes two values. The iterator @@ -156,13 +148,7 @@ pub fn revoke_subkey(config: Config, c: RevokeSubkeyCommand) -> Result<()> { } let secret = secret.into_iter().next(); - let time = if let Some(time) = c.time { - Some(parse_iso8601(&time, chrono::NaiveTime::from_hms(0, 0, 0)) - .context(format!("Bad value passed to --time: {:?}", - time))?.into()) - } else { - None - }; + let time = c.time.map(|t| t.time.into()); // Each --notation takes two values. The iterator // returns them one at a time, however. @@ -222,13 +208,7 @@ pub fn revoke_userid(config: Config, c: RevokeUseridCommand) -> Result<()> { } let secret = secret.into_iter().next(); - let time = if let Some(time) = c.time { - Some(parse_iso8601(&time, chrono::NaiveTime::from_hms(0, 0, 0)) - .context(format!("Bad value passed to --time: {:?}", - time))?.into()) - } else { - None - }; + let time = c.time.map(|t| t.time.into()); // Each --notation takes two values. The iterator // returns them one at a time, however. |