From aac8f14edf4986c4881267a5b76a58d6800945bb Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Mon, 21 May 2018 23:17:46 +0000 Subject: Use drop() instead of disconnect() Previously, the user had to explicitly call diconnect() to terminate the connection to the Nitrokey. Now NK_logout() is called automatically once the device is out of scope as UnauthenticatedDevice implements Drop. AdminAuthenticatedDevice and UserAuthenticatedDevice do not have to implement Drop, as it will be called recursively. --- src/tests/pro.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tests/pro.rs') diff --git a/src/tests/pro.rs b/src/tests/pro.rs index 732c248..feadcbc 100644 --- a/src/tests/pro.rs +++ b/src/tests/pro.rs @@ -48,7 +48,7 @@ fn connect() { #[cfg_attr(not(feature = "test-pro"), ignore)] fn disconnect() { set_debug(false); - ::connect().unwrap().disconnect(); + ::connect().unwrap(); unsafe { let ptr = ::nitrokey_sys::NK_device_serial_number(); assert!(!ptr.is_null()); -- cgit v1.2.1