Skip to content

Commit 5efb143

Browse files
authored
Miscellaneous clippy fixes. (#1344)
1 parent 907ed38 commit 5efb143

84 files changed

Lines changed: 150 additions & 154 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::env::var;
2-
use std::io::Write;
2+
use std::io::Write as _;
33

44
/// The directory for inline asm.
55
const ASM_PATH: &str = "src/backend/linux_raw/arch";

examples/termios.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#[cfg(all(not(windows), feature = "termios"))]
55
fn main() -> std::io::Result<()> {
66
use rustix::termios::{tcgetattr, tcsetattr, OptionalActions};
7-
use std::io::{Read, Write};
7+
use std::io::{Read as _, Write as _};
88

99
let tty = std::io::stdin();
1010
let termios = tcgetattr(&tty)?;

src/backend/libc/conv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
55
use super::c;
66
#[cfg(all(feature = "alloc", not(any(windows, target_os = "espidf"))))]
7-
use super::fd::IntoRawFd;
8-
use super::fd::{AsRawFd, BorrowedFd, FromRawFd, LibcFd, OwnedFd, RawFd};
7+
use super::fd::IntoRawFd as _;
8+
use super::fd::{AsRawFd as _, BorrowedFd, FromRawFd as _, LibcFd, OwnedFd, RawFd};
99
#[cfg(not(windows))]
1010
use crate::ffi::CStr;
1111
use crate::io;

src/backend/libc/event/poll_fd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::backend::c;
22
use crate::backend::conv::borrowed_fd;
3-
use crate::backend::fd::{AsFd, AsRawFd, BorrowedFd, LibcFd};
3+
use crate::backend::fd::{AsFd, AsRawFd as _, BorrowedFd, LibcFd};
44
#[cfg(windows)]
55
use crate::backend::fd::{AsSocket, RawFd};
66
use crate::ffi;

src/backend/libc/fs/dir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use crate::io;
3535
#[cfg(not(any(target_os = "fuchsia", target_os = "vita", target_os = "wasi")))]
3636
#[cfg(feature = "process")]
3737
use crate::process::fchdir;
38-
use alloc::borrow::ToOwned;
38+
use alloc::borrow::ToOwned as _;
3939
#[cfg(not(any(linux_like, target_os = "hurd")))]
4040
use c::readdir as libc_readdir;
4141
#[cfg(any(linux_like, target_os = "hurd"))]

src/backend/libc/io/syscalls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::backend::c;
44
#[cfg(not(target_os = "wasi"))]
55
use crate::backend::conv::ret_discarded_fd;
66
use crate::backend::conv::{borrowed_fd, ret, ret_c_int, ret_owned_fd, ret_usize};
7-
use crate::fd::{AsFd, BorrowedFd, OwnedFd, RawFd};
7+
use crate::fd::{AsFd as _, BorrowedFd, OwnedFd, RawFd};
88
#[cfg(not(any(
99
target_os = "aix",
1010
target_os = "espidf",

src/backend/libc/net/addr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl SocketAddrUnix {
136136
#[cfg(linux_kernel)]
137137
#[inline]
138138
pub fn abstract_name(&self) -> Option<&[u8]> {
139-
if let [0, ref bytes @ ..] = self.bytes()? {
139+
if let [0, bytes @ ..] = self.bytes()? {
140140
Some(bytes)
141141
} else {
142142
None

src/backend/libc/net/sockopt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ use crate::utils::as_mut_ptr;
6060
target_os = "fuchsia",
6161
target_os = "illumos"
6262
))]
63-
use alloc::borrow::ToOwned;
63+
use alloc::borrow::ToOwned as _;
6464
#[cfg(feature = "alloc")]
6565
#[cfg(any(
6666
linux_like,

src/backend/libc/process/syscalls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::backend::conv::{ret, ret_c_int};
2323
#[cfg(not(any(target_os = "wasi", target_os = "fuchsia")))]
2424
use crate::fd::BorrowedFd;
2525
#[cfg(target_os = "linux")]
26-
use crate::fd::{AsRawFd, OwnedFd, RawFd};
26+
use crate::fd::{AsRawFd as _, OwnedFd, RawFd};
2727
#[cfg(any(target_os = "linux", feature = "fs"))]
2828
use crate::ffi::CStr;
2929
#[cfg(feature = "fs")]

src/backend/libc/pty/syscalls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::io;
1717
use {
1818
crate::ffi::{CStr, CString},
1919
crate::path::SMALL_PATH_BUFFER_SIZE,
20-
alloc::borrow::ToOwned,
20+
alloc::borrow::ToOwned as _,
2121
alloc::vec::Vec,
2222
};
2323

0 commit comments

Comments
 (0)