diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2020-02-03 12:59:37 +0100 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2020-02-03 12:59:37 +0100 |
commit | a3dd6afb8c23c8975737d1484e152d530a975c11 (patch) | |
tree | 83c94299f3e8efdf288a569ea36e25a053b8d4f3 /src/config.rs | |
parent | 3bdc550ce31aa9a8aaec13b4901e8517d34272be (diff) | |
parent | 2a8ce725407f32db5ad61c37475719737c9b5c9c (diff) | |
download | nitrokey-rs-a3dd6afb8c23c8975737d1484e152d530a975c11.tar.gz nitrokey-rs-a3dd6afb8c23c8975737d1484e152d530a975c11.tar.bz2 |
Merge branch 'release-0.6.0'
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/config.rs b/src/config.rs index cb678d7..120a51b 100644 --- a/src/config.rs +++ b/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, } } } |