summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2018-05-21 23:17:46 +0000
committerRobin Krahl <robin.krahl@ireas.org>2018-05-22 01:19:42 +0200
commitaac8f14edf4986c4881267a5b76a58d6800945bb (patch)
tree3ecf8243bb354bff8d737cc44495ce31e96793f6 /src/tests
parenta9f51585b909c805bd441200c65e622217dc1a38 (diff)
downloadnitrokey-rs-aac8f14edf4986c4881267a5b76a58d6800945bb.tar.gz
nitrokey-rs-aac8f14edf4986c4881267a5b76a58d6800945bb.tar.bz2
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.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/pro.rs2
1 files changed, 1 insertions, 1 deletions
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());