diff options
| author | Tomoaki Kawada <kawada@kmckk.co.jp> | 2022-12-01 11:03:43 +0900 |
|---|---|---|
| committer | Tomoaki Kawada <kawada@kmckk.co.jp> | 2022-12-01 13:18:05 +0900 |
| commit | f482e55adf3fb76860d304c9b7f5c7f3f9a40717 (patch) | |
| tree | 6947d8908d66e8fcb708e0a5a9515b5654452cfc | |
| parent | 47f2f6d615a70b29a4ef76ebf480703655a0ea05 (diff) | |
| download | rust-f482e55adf3fb76860d304c9b7f5c7f3f9a40717.tar.gz rust-f482e55adf3fb76860d304c9b7f5c7f3f9a40717.zip | |
kmc-solid: Address compiler warnings
Addresses the warn-by-default lints `unused_imports` and `unused_unsafe`.
| -rw-r--r-- | library/std/src/sys/itron/condvar.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sys/itron/mutex.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/solid/os.rs | 3 |
3 files changed, 4 insertions, 5 deletions
diff --git a/library/std/src/sys/itron/condvar.rs b/library/std/src/sys/itron/condvar.rs index f70aa434e48..7a47cc6696a 100644 --- a/library/std/src/sys/itron/condvar.rs +++ b/library/std/src/sys/itron/condvar.rs @@ -71,7 +71,7 @@ impl Condvar { } } - unsafe { mutex.lock() }; + mutex.lock(); } pub unsafe fn wait_timeout(&self, mutex: &Mutex, dur: Duration) -> bool { @@ -109,7 +109,7 @@ impl Condvar { // we woke up because of `notify_*`. let success = self.waiters.with_locked(|waiters| unsafe { !waiters.remove(waiter) }); - unsafe { mutex.lock() }; + mutex.lock(); success } } diff --git a/library/std/src/sys/itron/mutex.rs b/library/std/src/sys/itron/mutex.rs index f2eed8e771c..1f6cc419476 100644 --- a/library/std/src/sys/itron/mutex.rs +++ b/library/std/src/sys/itron/mutex.rs @@ -72,7 +72,7 @@ pub(super) struct MutexGuard<'a>(&'a Mutex); impl<'a> MutexGuard<'a> { #[inline] pub(super) fn lock(x: &'a Mutex) -> Self { - unsafe { x.lock() }; + x.lock(); Self(x) } } diff --git a/library/std/src/sys/solid/os.rs b/library/std/src/sys/solid/os.rs index 4906c62689d..6135921f0b5 100644 --- a/library/std/src/sys/solid/os.rs +++ b/library/std/src/sys/solid/os.rs @@ -1,7 +1,6 @@ use super::unsupported; -use crate::convert::TryFrom; use crate::error::Error as StdError; -use crate::ffi::{CStr, CString, OsStr, OsString}; +use crate::ffi::{CStr, OsStr, OsString}; use crate::fmt; use crate::io; use crate::os::{ |
