From 91c5aa86b35c83f46d62ebdddd5f0868d18b9fc7 Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Tue, 2 Jul 2019 03:11:37 +1000 Subject: [PATCH] Fix Driver destructor behaviour in asio-sys --- asio-sys/src/bindings/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asio-sys/src/bindings/mod.rs b/asio-sys/src/bindings/mod.rs index 93f0e59..201ece4 100644 --- a/asio-sys/src/bindings/mod.rs +++ b/asio-sys/src/bindings/mod.rs @@ -479,7 +479,7 @@ impl Driver { }) }, // Impossible - (None, None) => panic!("Trying to create streams without preparing"), + (None, None) => unreachable!("Trying to create streams without preparing"), } } @@ -687,7 +687,7 @@ impl DriverInner { impl Drop for DriverInner { fn drop(&mut self) { - if self.destroyed { + if !self.destroyed { // We probably shouldn't `panic!` in the destructor? We also shouldn't ignore errors // though either. self.destroy_inner().ok();