fix(utils): remove unused imports to fix Windows clippy warnings

- Remove unused io::self import from common scope
- Remove unused std::fs::OpenOptions and std::io::Write from windows_impl
- Add std::io import to unix_impl to fix io::Error references
- Ensure clippy passes with -D warnings on all platforms
This commit is contained in:
bahdotsh
2025-08-27 15:39:52 +05:30
parent 5e9658c885
commit 5161882989

View File

@@ -43,7 +43,7 @@ pub fn is_workflow_file(path: &Path) -> bool {
/// differences in file descriptor handling. The functions will execute without /// differences in file descriptor handling. The functions will execute without
/// error but stderr may not be fully suppressed. /// error but stderr may not be fully suppressed.
pub mod fd { pub mod fd {
use std::io::{self, Result}; use std::io::Result;
/// Represents a redirected stderr that can be restored /// Represents a redirected stderr that can be restored
pub struct RedirectedStderr { pub struct RedirectedStderr {
@@ -61,6 +61,7 @@ pub mod fd {
use nix::fcntl::{open, OFlag}; use nix::fcntl::{open, OFlag};
use nix::sys::stat::Mode; use nix::sys::stat::Mode;
use nix::unistd::{close, dup, dup2}; use nix::unistd::{close, dup, dup2};
use std::io;
use std::os::unix::io::RawFd; use std::os::unix::io::RawFd;
use std::path::Path; use std::path::Path;
@@ -119,8 +120,6 @@ pub mod fd {
#[cfg(windows)] #[cfg(windows)]
mod windows_impl { mod windows_impl {
use super::*; use super::*;
use std::fs::OpenOptions;
use std::io::Write;
impl RedirectedStderr { impl RedirectedStderr {
/// Creates a new RedirectedStderr that redirects stderr to NUL on Windows /// Creates a new RedirectedStderr that redirects stderr to NUL on Windows