From 4a9dab94400cb00ae1e28485ddc64d46cf27ed3c Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Wed, 29 Jan 2020 14:04:06 +0100 Subject: Implement From<&NK_status> for RawConfig This makes it easier to parse only the config part of the NK_status struct and avoids code duplication in the upcoming get_config refactoring. --- src/device/mod.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/device') diff --git a/src/device/mod.rs b/src/device/mod.rs index a25ad1b..403bb1f 100644 --- a/src/device/mod.rs +++ b/src/device/mod.rs @@ -191,13 +191,7 @@ impl From for Status { minor: status.firmware_version_minor, }, serial_number: status.serial_number_smart_card, - config: RawConfig { - numlock: status.config_numlock, - capslock: status.config_capslock, - scrollock: status.config_scrolllock, - user_password: status.otp_user_password, - } - .into(), + config: RawConfig::from(&status).into(), } } } -- cgit v1.2.3