From 8f7eb1679fa988ad97b0e6dbe0ef5d1edef18351 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Mon, 28 May 2018 20:32:10 +0000 Subject: 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. --- src/tests/pro.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/tests') 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()); -- cgit v1.2.3