aboutsummaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2018-05-28 20:32:10 +0000
committerRobin Krahl <robin.krahl@ireas.org>2018-05-28 22:33:57 +0200
commit8f7eb1679fa988ad97b0e6dbe0ef5d1edef18351 (patch)
treedc1735d256383e194189fc586d10ebe5750eaee6 /src/tests
parent15706f8708af4175a5376026cdd7c6f821945a5d (diff)
downloadnitrokey-rs-8f7eb1679fa988ad97b0e6dbe0ef5d1edef18351.tar.gz
nitrokey-rs-8f7eb1679fa988ad97b0e6dbe0ef5d1edef18351.tar.bz2
Restructure trait implementations for wrappers
For DeviceWrapper, the traits GenerateOtp and Device are now directly implemented instead of complicated template implementations. For User and Admin, the wrapper implementations are replaced with an implementation of the Deref trait for easier access.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/pro.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tests/pro.rs b/src/tests/pro.rs
index e52c287..5415ff9 100644
--- a/src/tests/pro.rs
+++ b/src/tests/pro.rs
@@ -1,4 +1,5 @@
use std::ffi::CStr;
+use std::ops::Deref;
use {Admin, Authenticate, CommandError, CommandStatus, Config, ConfigureOtp, Device, GenerateOtp,
OtpMode, OtpSlotData, Pro};
@@ -101,7 +102,7 @@ fn hotp() {
assert_eq!(CommandStatus::Success, admin.write_config(config));
configure_hotp(&admin);
- check_hotp_codes(&admin);
+ check_hotp_codes(admin.deref());
configure_hotp(&admin);
check_hotp_codes(&admin.device());
@@ -203,7 +204,7 @@ fn totp() {
assert_eq!(CommandStatus::Success, admin.write_config(config));
configure_totp(&admin);
- check_totp_codes(&admin);
+ check_totp_codes(admin.deref());
configure_totp(&admin);
check_totp_codes(&admin.device());