Commit 8c57d1eae9
Unsigned
Layout: unified · split
src/commands/devices.rs +5 −3
| @@ -74,12 +74,14 @@ impl DevicesCommand { | ||
| 74 | 74 | match args.subcommand() { |
| 75 | 75 | ("list", _) => Self::list(servers, buffer), |
| 76 | 76 | ("delete", args) => { |
| 77 | let devices = args.unwrap().args.get("device-id").unwrap(); | |
| 77 | let devices = args | |
| 78 | .and_then(|a| a.args.get("device-id")) | |
| 79 | .expect("Args didn't contain any device ids"); | |
| 78 | 80 | let devices: Vec<DeviceIdBox> = devices |
| 79 | 81 | .vals |
| 80 | 82 | .iter() |
| 81 | .filter_map(|d| { | |
| 82 | d.clone().into_string().ok().map(|d| d.into()) | |
| 83 | .map(|d| { | |
| 84 | d.clone().to_string_lossy().as_ref().into() | |
| 83 | 85 | }) |
| 84 | 86 | .collect(); |
| 85 | 87 | Self::delete(servers, buffer, devices); |