From 8b0ee22e1b84b3e942325a6f9874034893f7fb6a Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Wed, 25 Sep 2019 00:26:19 -0400 Subject: [PATCH] Clippy cleanup --- src/client.rs | 2 +- src/driver.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client.rs b/src/client.rs index ceeb0f2..0702c24 100644 --- a/src/client.rs +++ b/src/client.rs @@ -12,7 +12,7 @@ impl ClientContext { fn get_user_name() -> String { env::var("USER") .or_else(|_| env::var("USERNAME")) - .unwrap_or("default".to_string()) + .unwrap_or_else(|_| "default".to_string()) } /// Get the default folder used by the Media Driver to interact with clients diff --git a/src/driver.rs b/src/driver.rs index 0ca3a95..26bde37 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -95,10 +95,10 @@ impl MediaDriver { impl Drop for MediaDriver { fn drop(&mut self) { - if self.c_driver != ptr::null_mut() { + if self.c_driver.is_null() { unsafe { aeron_op!(aeron_driver_close(self.c_driver)) }.unwrap(); } - if self.c_context != ptr::null_mut() { + if self.c_context.is_null() { unsafe { aeron_op!(aeron_driver_context_close(self.c_context)) }.unwrap(); } }