diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2020-01-29 12:25:33 +0100 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2020-02-03 09:40:32 -0800 |
commit | 51d0fbb73eb42325fb2a0832810fd9e1d4339743 (patch) | |
tree | 766cfda4a1a9e47ac6cef5f558b3dc93c8372eeb /nitrokey/src/config.rs | |
parent | 3dd4b7795f9a9a4285fe6add70a578e3a84bb59f (diff) | |
download | nitrocli-51d0fbb73eb42325fb2a0832810fd9e1d4339743.tar.gz nitrocli-51d0fbb73eb42325fb2a0832810fd9e1d4339743.tar.bz2 |
Update nitrokey dependency to 0.6.0
nitrokey 0.6.0 introduced the SerialNumber struct (instead of
representing serial numbers as strings). We no longer have to manually
format the serial number as SerialNumber implements Display.
Import subrepo nitrokey/:nitrokey at 2a8ce725407f32db5ad61c37475719737c9b5c9c
Diffstat (limited to 'nitrokey/src/config.rs')
-rw-r--r-- | nitrokey/src/config.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/nitrokey/src/config.rs b/nitrokey/src/config.rs index cb678d7..120a51b 100644 --- a/nitrokey/src/config.rs +++ b/nitrokey/src/config.rs @@ -83,13 +83,13 @@ impl convert::TryFrom<Config> for RawConfig { } } -impl From<[u8; 5]> for RawConfig { - fn from(data: [u8; 5]) -> Self { - RawConfig { - numlock: data[0], - capslock: data[1], - scrollock: data[2], - user_password: data[3] != 0, +impl From<&nitrokey_sys::NK_status> for RawConfig { + fn from(status: &nitrokey_sys::NK_status) -> Self { + Self { + numlock: status.config_numlock, + capslock: status.config_capslock, + scrollock: status.config_scrolllock, + user_password: status.otp_user_password, } } } |