diff --git a/Cargo.toml b/Cargo.toml index 0beb3d5308..24dbc8c66b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ cast_possible_wrap = "allow" # TODO review occurrences cast_precision_loss = "allow" # TODO review occurrences cast_ptr_alignment = "allow" # TODO review occurrences cast_sign_loss = "allow" # TODO review occurrences +ignored_unit_patterns = "deny" missing_errors_doc = "allow" # TODO review occurrences missing_panics_doc = "allow" # TODO review occurrences missing_safety_doc = "allow" # TODO review occurrences diff --git a/src/header/dirent/mod.rs b/src/header/dirent/mod.rs index de3e1f53f8..25c76e9d91 100644 --- a/src/header/dirent/mod.rs +++ b/src/header/dirent/mod.rs @@ -140,7 +140,7 @@ impl DIR { Ok(dent_ptr) } fn seek(&mut self, off: u64) { - let Ok(_) = Sys::dir_seek(*self.file, off) else { + let Ok(()) = Sys::dir_seek(*self.file, off) else { return; }; self.buf.clear(); @@ -149,7 +149,7 @@ impl DIR { } fn rewind(&mut self) { self.opaque_offset = 0; - let Ok(_) = Sys::dir_seek(*self.file, 0) else { + let Ok(()) = Sys::dir_seek(*self.file, 0) else { return; }; self.buf.clear(); diff --git a/src/header/poll/mod.rs b/src/header/poll/mod.rs index 83dac36306..7de0ba5a5b 100644 --- a/src/header/poll/mod.rs +++ b/src/header/poll/mod.rs @@ -112,7 +112,7 @@ pub unsafe fn poll_epoll(fds: &mut [pollfd], timeout: c_int, sigmask: *const sig } match unsafe { Sys::epoll_ctl(*ep, EPOLL_CTL_ADD, pfd.fd, &raw mut event) } { - Ok(_) => {} + Ok(()) => {} Err(Errno(EBADF)) => { pfd.revents |= POLLNVAL; closed += 1; diff --git a/src/header/semaphore/mod.rs b/src/header/semaphore/mod.rs index b38d3cf5d4..c8ed7f5365 100644 --- a/src/header/semaphore/mod.rs +++ b/src/header/semaphore/mod.rs @@ -93,7 +93,7 @@ pub unsafe extern "C" fn sem_unlink(name: *const c_char) -> c_int { pub unsafe extern "C" fn sem_wait(sem: *mut sem_t) -> c_int { unsafe { get(sem) } .wait(None, time::CLOCK_MONOTONIC) - .map(|_| 0) + .map(|()| 0) .or_minus_one_errno() } @@ -106,7 +106,7 @@ pub unsafe extern "C" fn sem_clockwait( ) -> c_int { unsafe { get(sem) } .wait(Some(&unsafe { (*abstime).clone() }), clock_id) - .map(|_| 0) + .map(|()| 0) .or_minus_one_errno() } @@ -115,7 +115,7 @@ pub unsafe extern "C" fn sem_clockwait( pub unsafe extern "C" fn sem_timedwait(sem: *mut sem_t, abstime: *const timespec) -> c_int { unsafe { get(sem) } .wait(Some(&unsafe { (*abstime).clone() }), time::CLOCK_REALTIME) - .map(|_| 0) + .map(|()| 0) .or_minus_one_errno() } diff --git a/src/header/stdio/mod.rs b/src/header/stdio/mod.rs index 93e717c827..0a3442a929 100644 --- a/src/header/stdio/mod.rs +++ b/src/header/stdio/mod.rs @@ -206,15 +206,13 @@ impl Write for FILE { impl WriteFmt for FILE { fn write_str(&mut self, s: &str) -> fmt::Result { - self.write_all(s.as_bytes()) - .map(|_| ()) - .map_err(|_| fmt::Error) + self.write_all(s.as_bytes()).map_err(|_| fmt::Error) } } impl WriteByte for FILE { fn write_u8(&mut self, c: u8) -> fmt::Result { - self.write_all(&[c]).map(|_| ()).map_err(|_| fmt::Error) + self.write_all(&[c]).map_err(|_| fmt::Error) } } diff --git a/src/header/sys_shm/mod.rs b/src/header/sys_shm/mod.rs index f57543619e..5e30eff7bb 100644 --- a/src/header/sys_shm/mod.rs +++ b/src/header/sys_shm/mod.rs @@ -135,7 +135,7 @@ pub unsafe extern "C" fn shmdt(shmaddr: *const c_void) -> c_int { let total_size = unsafe { (*header).total_size }; unsafe { Sys::munmap(base_ptr.cast::(), total_size) } - .map(|_| 0) + .map(|()| 0) .or_minus_one_errno() } @@ -143,7 +143,7 @@ pub unsafe extern "C" fn shmdt(shmaddr: *const c_void) -> c_int { #[unsafe(no_mangle)] pub unsafe extern "C" fn shmctl(shmid: c_int, cmd: c_int, buf: *mut shmid_ds) -> c_int { match cmd { - IPC_RMID => Sys::close(shmid).map(|_| 0).or_minus_one_errno(), + IPC_RMID => Sys::close(shmid).map(|()| 0).or_minus_one_errno(), IPC_STAT => { if buf.is_null() { ERRNO.set(EINVAL); diff --git a/src/header/time/mod.rs b/src/header/time/mod.rs index b4c708042a..0c9636a1cb 100644 --- a/src/header/time/mod.rs +++ b/src/header/time/mod.rs @@ -236,7 +236,7 @@ pub unsafe extern "C" fn asctime_r(tm: *const tm, buf: *mut c_char) -> *mut c_ch ), ); match write_result { - Ok(_) => buf, + Ok(()) => buf, Err(_) => { /* asctime()/asctime_r() or the equivalent sprintf() call * have no defined errno setting */ diff --git a/src/io/buffered.rs b/src/io/buffered.rs index d2d232ab7e..be1cbc83a6 100644 --- a/src/io/buffered.rs +++ b/src/io/buffered.rs @@ -505,7 +505,7 @@ impl Seek for BufWriter { /// /// Seeking always writes out the internal buffer before seeking. fn seek(&mut self, pos: SeekFrom) -> io::Result { - self.flush_buf().and_then(|_| self.get_mut().seek(pos)) + self.flush_buf().and_then(|()| self.get_mut().seek(pos)) } }