diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2019-07-09 08:09:02 +0000 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2019-07-09 08:27:55 +0000 |
commit | 12fa62483cf45d868099d5d4020333af492eebde (patch) | |
tree | 2ad466dbfeafb21365a3625f0beb8e2c6c392b2f /tests/otp.rs | |
parent | fe2f39826ade5a156945dabb8c8ab725378a15c1 (diff) | |
download | nitrokey-rs-12fa62483cf45d868099d5d4020333af492eebde.tar.gz nitrokey-rs-12fa62483cf45d868099d5d4020333af492eebde.tar.bz2 |
Introduce into_manager for Device
To enable applications like nitrokey-test to go back to a manager
instance from a Device instance, we add the into_manager function to the
Device trait. To do that, we have to keep track of the Manager’s
lifetime by adding a lifetime to Device (and then to some other traits
that use Device).
Diffstat (limited to 'tests/otp.rs')
-rw-r--r-- | tests/otp.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/otp.rs b/tests/otp.rs index c0bbecf..aafda59 100644 --- a/tests/otp.rs +++ b/tests/otp.rs @@ -36,9 +36,9 @@ enum TotpTimestampSize { U64, } -fn make_admin_test_device<T>(device: T) -> Admin<T> +fn make_admin_test_device<'a, T>(device: T) -> Admin<'a, T> where - T: Device, + T: Device<'a>, (T, nitrokey::Error): Debug, { unwrap_ok!(device.authenticate_admin(DEFAULT_ADMIN_PIN)) |