mirror of
https://github.com/bahdotsh/wrkflw.git
synced 2026-02-23 19:39:42 +01:00
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.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user