From ac44b0a26a7f5ed35ddbc943b642df07503d5666 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Tue, 29 Sep 2020 20:24:13 -0700 Subject: fixup! Add --serial-number option --- src/config.rs | 8 ++++---- 1 file 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, { - let strings: Vec = serde::Deserialize::deserialize(d).map_err(D::Error::custom)?; - let result: Result, _> = strings + let strings = Vec::::deserialize(d).map_err(D::Error::custom)?; + let result = strings .iter() .map(|s| nitrokey::SerialNumber::from_str(s)) - .collect(); + .collect::>(); 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() { -- cgit v1.2.3