1
0
mirror of https://github.com/bspeice/aeron-rs synced 2024-12-21 21:38:09 -05:00

Clippy cleanup

This commit is contained in:
Bradlee Speice 2019-09-25 00:26:19 -04:00
parent 774a9a6b30
commit 8b0ee22e1b
2 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ impl ClientContext {
fn get_user_name() -> String { fn get_user_name() -> String {
env::var("USER") env::var("USER")
.or_else(|_| env::var("USERNAME")) .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 /// Get the default folder used by the Media Driver to interact with clients

View File

@ -95,10 +95,10 @@ impl MediaDriver {
impl Drop for MediaDriver { impl Drop for MediaDriver {
fn drop(&mut self) { 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(); 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(); unsafe { aeron_op!(aeron_driver_context_close(self.c_context)) }.unwrap();
} }
} }