Fix Driver destructor behaviour in asio-sys

This commit is contained in:
mitchmindtree 2019-07-02 03:11:37 +10:00
parent 9182f00e20
commit 91c5aa86b3
1 changed files with 2 additions and 2 deletions

View File

@ -479,7 +479,7 @@ impl Driver {
}) })
}, },
// Impossible // 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 { impl Drop for DriverInner {
fn drop(&mut self) { fn drop(&mut self) {
if self.destroyed { if !self.destroyed {
// We probably shouldn't `panic!` in the destructor? We also shouldn't ignore errors // We probably shouldn't `panic!` in the destructor? We also shouldn't ignore errors
// though either. // though either.
self.destroy_inner().ok(); self.destroy_inner().ok();