Merge branch 'ignored-unit-patterns' into 'master'

apply ignored_unit_patterns clippy lint

See merge request redox-os/relibc!1456
This commit is contained in:
Jeremy Soller
2026-06-11 09:25:03 -06:00
8 changed files with 13 additions and 14 deletions
+1
View File
@@ -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
+2 -2
View File
@@ -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();
+1 -1
View File
@@ -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;
+3 -3
View File
@@ -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()
}
+2 -4
View File
@@ -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)
}
}
+2 -2
View File
@@ -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::<c_void>(), 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);
+1 -1
View File
@@ -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 */
+1 -1
View File
@@ -505,7 +505,7 @@ impl<W: Write + Seek> Seek for BufWriter<W> {
///
/// Seeking always writes out the internal buffer before seeking.
fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
self.flush_buf().and_then(|_| self.get_mut().seek(pos))
self.flush_buf().and_then(|()| self.get_mut().seek(pos))
}
}