aboutsummaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-07-09 08:09:02 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-07-09 08:27:55 +0000
commit12fa62483cf45d868099d5d4020333af492eebde (patch)
tree2ad466dbfeafb21365a3625f0beb8e2c6c392b2f /src/error.rs
parentfe2f39826ade5a156945dabb8c8ab725378a15c1 (diff)
downloadnitrokey-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 'src/error.rs')
-rw-r--r--src/error.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/error.rs b/src/error.rs
index b84f5eb..9e6adc0 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -85,7 +85,7 @@ impl From<sync::TryLockError<sync::MutexGuard<'static, crate::Manager>>> for Err
}
}
-impl<T: device::Device> From<(T, Error)> for Error {
+impl<'a, T: device::Device<'a>> From<(T, Error)> for Error {
fn from((_, err): (T, Error)) -> Self {
err
}