From 699c9250f20288ee59e1217b2ea8ea12b159d6bf Mon Sep 17 00:00:00 2001 From: bahdotsh Date: Sat, 9 Aug 2025 11:16:11 +0530 Subject: [PATCH] fix(utils): Replace deprecated io::Error::new with io::Error::other Replace io::Error::new(io::ErrorKind::Other, e) with the newer io::Error::other(e) method as recommended by clippy. This fixes CI failures when running with -D warnings that treat clippy::io_other_error as an error. --- crates/utils/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/utils/src/lib.rs b/crates/utils/src/lib.rs index 0169e9f..f1da2fc 100644 --- a/crates/utils/src/lib.rs +++ b/crates/utils/src/lib.rs @@ -58,7 +58,7 @@ pub mod fd { // Duplicate the current stderr fd let stderr_backup = match dup(STDERR_FILENO) { Ok(fd) => fd, - Err(e) => return Err(io::Error::new(io::ErrorKind::Other, e)), + Err(e) => return Err(io::Error::other(e)), }; // Open /dev/null @@ -66,7 +66,7 @@ pub mod fd { Ok(fd) => fd, Err(e) => { let _ = close(stderr_backup); // Clean up on error - return Err(io::Error::new(io::ErrorKind::Other, e)); + return Err(io::Error::other(e)); } }; @@ -74,7 +74,7 @@ pub mod fd { if let Err(e) = dup2(null_fd, STDERR_FILENO) { let _ = close(stderr_backup); // Clean up on error let _ = close(null_fd); - return Err(io::Error::new(io::ErrorKind::Other, e)); + return Err(io::Error::other(e)); } Ok(RedirectedStderr {