From 08e05a5f66d14d4f06288c9a725e87f473eba41a Mon Sep 17 00:00:00 2001 From: SteveLauC Date: Sat, 24 Feb 2024 10:59:35 +0800 Subject: [PATCH] refactor: remove redundant imports to fix CI (#2320) * refactor: remove redundant imports to fix CI * refactor: remove redundant imports to fix CI --- src/errno.rs | 1 - src/fcntl.rs | 2 +- src/sys/time.rs | 1 - src/unistd.rs | 3 +-- test/sys/test_select.rs | 1 - test/sys/test_signal.rs | 1 - test/sys/test_termios.rs | 1 - 7 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/errno.rs b/src/errno.rs index 114a4a1eab..2e74a84454 100644 --- a/src/errno.rs +++ b/src/errno.rs @@ -14,7 +14,6 @@ use crate::Result; use cfg_if::cfg_if; use libc::{c_int, c_void}; -use std::convert::TryFrom; use std::{error, fmt, io}; pub use self::consts::*; diff --git a/src/fcntl.rs b/src/fcntl.rs index ed197ecf26..ccefe955de 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -2,7 +2,7 @@ use crate::errno::Errno; #[cfg(all(target_os = "freebsd", target_arch = "x86_64"))] use core::slice; -use libc::{self, c_int, c_uint, size_t, ssize_t}; +use libc::{c_int, c_uint, size_t, ssize_t}; #[cfg(any( target_os = "netbsd", apple_targets, diff --git a/src/sys/time.rs b/src/sys/time.rs index b19dee91a0..af436cabd5 100644 --- a/src/sys/time.rs +++ b/src/sys/time.rs @@ -2,7 +2,6 @@ // https://github.com/rust-lang/libc/issues/1848 pub use libc::{suseconds_t, time_t}; use libc::{timespec, timeval}; -use std::convert::From; use std::time::Duration; use std::{cmp, fmt, ops}; diff --git a/src/unistd.rs b/src/unistd.rs index ce2d42455a..4502766c5d 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -31,8 +31,7 @@ use crate::{Error, NixPath, Result}; #[cfg(not(target_os = "redox"))] use cfg_if::cfg_if; use libc::{ - self, c_char, c_int, c_long, c_uint, gid_t, mode_t, off_t, pid_t, size_t, - uid_t, + c_char, c_int, c_long, c_uint, gid_t, mode_t, off_t, pid_t, size_t, uid_t, }; use std::convert::Infallible; #[cfg(not(target_os = "redox"))] diff --git a/test/sys/test_select.rs b/test/sys/test_select.rs index 746c6b6966..e39a31923a 100644 --- a/test/sys/test_select.rs +++ b/test/sys/test_select.rs @@ -68,7 +68,6 @@ macro_rules! generate_fdset_bad_fd_tests { mod test_fdset_too_large_fd { use super::*; - use std::convert::TryInto; generate_fdset_bad_fd_tests!( FD_SETSIZE.try_into().unwrap(), insert, diff --git a/test/sys/test_signal.rs b/test/sys/test_signal.rs index 12872f1228..bf607497be 100644 --- a/test/sys/test_signal.rs +++ b/test/sys/test_signal.rs @@ -1,7 +1,6 @@ use nix::errno::Errno; use nix::sys::signal::*; use nix::unistd::*; -use std::convert::TryFrom; use std::hash::{Hash, Hasher}; use std::sync::atomic::{AtomicBool, Ordering}; #[cfg(not(target_os = "redox"))] diff --git a/test/sys/test_termios.rs b/test/sys/test_termios.rs index 72399cf6a5..35cc7ab739 100644 --- a/test/sys/test_termios.rs +++ b/test/sys/test_termios.rs @@ -1,4 +1,3 @@ -use std::convert::TryFrom; use std::os::unix::io::{AsFd, AsRawFd}; use tempfile::tempfile;