Browse Source

Fix clippy lints / rustc warnings

pull/18/head
Ian Chamberlain 3 years ago
parent
commit
dfa03fb324
No known key found for this signature in database
GPG Key ID: AE5484D09405AA60
  1. 2
      src/lib.rs
  2. 4
      src/thread.rs

2
src/lib.rs

@ -14,7 +14,7 @@ mod thread_keys;
/// Call this somewhere to force Rust to link this module. /// Call this somewhere to force Rust to link this module.
/// The call doesn't need to execute, just exist. /// The call doesn't need to execute, just exist.
/// ///
/// See https://github.com/rust-lang/rust/issues/47384 /// See <https://github.com/rust-lang/rust/issues/47384>
#[inline(always)] #[inline(always)]
pub fn init() { pub fn init() {
condvar::init(); condvar::init();

4
src/thread.rs

@ -223,7 +223,7 @@ pub unsafe extern "C" fn pthread_self() -> libc::pthread_t {
// We have to ignore the possible error from svcGetThreadId since // We have to ignore the possible error from svcGetThreadId since
// pthread_self cannot fail... But there shouldn't be an error anyways. // pthread_self cannot fail... But there shouldn't be an error anyways.
let mut os_thread_id = 0; let mut os_thread_id = 0;
ctru_sys::svcGetThreadId(&mut os_thread_id, ctru_sys::CUR_THREAD_HANDLE); let _ = ctru_sys::svcGetThreadId(&mut os_thread_id, ctru_sys::CUR_THREAD_HANDLE);
THREADS.write().insert( THREADS.write().insert(
MAIN_THREAD_ID, MAIN_THREAD_ID,
@ -280,7 +280,7 @@ impl Drop for Handle {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {
// We ignore the error because we can't return it or panic. // We ignore the error because we can't return it or panic.
ctru_sys::svcCloseHandle(self.0); let _ = ctru_sys::svcCloseHandle(self.0);
} }
} }
} }

Loading…
Cancel
Save