aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2020-09-29 20:24:13 -0700
committerDaniel Mueller <deso@posteo.net>2020-09-29 20:24:13 -0700
commitac44b0a26a7f5ed35ddbc943b642df07503d5666 (patch)
tree8c8d4237fa1d469e16609535f7da947b731e9713 /src
parentc400e136dd9e50d006ebdff55d5617139fa96b9c (diff)
downloadnitrocli-ac44b0a26a7f5ed35ddbc943b642df07503d5666.tar.gz
nitrocli-ac44b0a26a7f5ed35ddbc943b642df07503d5666.tar.bz2
fixup! Add --serial-number option
Diffstat (limited to 'src')
-rw-r--r--src/config.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/config.rs b/src/config.rs
index 8e7eefb..4bd3886 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -8,6 +8,7 @@ use std::path;
use std::str::FromStr as _;
use serde::de::Error as _;
+use serde::Deserialize as _;
use crate::args;
@@ -47,11 +48,11 @@ fn deserialize_serial_number_vec<'de, D>(d: D) -> Result<Vec<nitrokey::SerialNum
where
D: serde::Deserializer<'de>,
{
- let strings: Vec<String> = serde::Deserialize::deserialize(d).map_err(D::Error::custom)?;
- let result: Result<Vec<_>, _> = strings
+ let strings = Vec::<String>::deserialize(d).map_err(D::Error::custom)?;
+ let result = strings
.iter()
.map(|s| nitrokey::SerialNumber::from_str(s))
- .collect();
+ .collect::<Result<_, _>>();
result.map_err(D::Error::custom)
}
@@ -73,7 +74,6 @@ impl Config {
self.model = args.model;
}
if !args.serial_numbers.is_empty() {
- // TODO: Don't clone.
self.serial_numbers = args.serial_numbers.clone();
}
if args.usb_path.is_some() {