aboutsummaryrefslogtreecommitdiff
path: root/src/args.rs
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2020-09-08 19:18:13 +0200
committerRobin Krahl <robin.krahl@ireas.org>2020-09-09 21:55:12 +0200
commit80fbab0f4dcdd6e172fab00794fb943bbe81fa1e (patch)
treec8d2ca743596d7b3d38aaf7521c60add81199b3c /src/args.rs
parent663f24b2e41c90709750337e47f2f43b3100422f (diff)
downloadnitrocli-80fbab0f4dcdd6e172fab00794fb943bbe81fa1e.tar.gz
nitrocli-80fbab0f4dcdd6e172fab00794fb943bbe81fa1e.tar.bz2
Use DeviceModel::as_user_facing_str in status
This match replaces the model names in the status command with calls to the DeviceModel::as_user_facing_str method.
Diffstat (limited to 'src/args.rs')
-rw-r--r--src/args.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/args.rs b/src/args.rs
index 80abe17..ab46ee7 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -50,6 +50,15 @@ impl DeviceModel {
}
}
+impl From<nitrokey::Model> for DeviceModel {
+ fn from(model: nitrokey::Model) -> DeviceModel {
+ match model {
+ nitrokey::Model::Pro => DeviceModel::Pro,
+ nitrokey::Model::Storage => DeviceModel::Storage,
+ }
+ }
+}
+
impl From<DeviceModel> for nitrokey::Model {
fn from(model: DeviceModel) -> nitrokey::Model {
match model {