From 76ea8cbad284560b39048e7de0e8c1aa09f64653 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 12 Apr 2023 11:04:04 -0700 Subject: [PATCH] Fix some clippy lints. --- cap-fs-ext/src/dir_ext.rs | 2 +- cap-net-ext/src/lib.rs | 2 +- cap-primitives/src/rustix/linux/fs/open_impl.rs | 2 +- cap-tempfile/src/utf8.rs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cap-fs-ext/src/dir_ext.rs b/cap-fs-ext/src/dir_ext.rs index 88d2fd17..443618af 100644 --- a/cap-fs-ext/src/dir_ext.rs +++ b/cap-fs-ext/src/dir_ext.rs @@ -982,7 +982,7 @@ impl DirExtUtf8 for cap_std::fs_utf8::Dir { &self.as_filelike_view::(), path.as_ref().as_ref(), ) { - Ok(file) => Ok(Self::from_std_file(file.into())), + Ok(file) => Ok(Self::from_std_file(file)), Err(e) => Err(e), } } diff --git a/cap-net-ext/src/lib.rs b/cap-net-ext/src/lib.rs index 0c90f4c2..b4ff1efc 100644 --- a/cap-net-ext/src/lib.rs +++ b/cap-net-ext/src/lib.rs @@ -336,7 +336,7 @@ impl PoolExt for Pool { for addr in addrs { self._pool().check_addr(&addr)?; - match rustix::net::connect(&socket, &addr) { + match rustix::net::connect(socket, &addr) { Ok(()) => return Ok(()), Err(err) => last_err = Some(err), } diff --git a/cap-primitives/src/rustix/linux/fs/open_impl.rs b/cap-primitives/src/rustix/linux/fs/open_impl.rs index 515f5a76..d8611e38 100644 --- a/cap-primitives/src/rustix/linux/fs/open_impl.rs +++ b/cap-primitives/src/rustix/linux/fs/open_impl.rs @@ -37,7 +37,7 @@ pub(crate) fn open_impl( // If we got anything other than a `ENOSYS` error, that's our result. match result { Err(err) if err.raw_os_error() == Some(rustix::io::Errno::NOSYS.raw_os_error()) => {} - Err(err) => return Err(err.into()), + Err(err) => return Err(err), Ok(fd) => return Ok(fd), } } diff --git a/cap-tempfile/src/utf8.rs b/cap-tempfile/src/utf8.rs index 6cb5ecd9..bdae30b2 100644 --- a/cap-tempfile/src/utf8.rs +++ b/cap-tempfile/src/utf8.rs @@ -71,9 +71,9 @@ impl TempDir { pub fn new_in(dir: &Dir) -> io::Result { for _ in 0..Self::num_iterations() { let name = &Self::new_name(); - match dir.create_dir(&name) { + match dir.create_dir(name) { Ok(()) => { - let dir = match dir.open_dir(&name) { + let dir = match dir.open_dir(name) { Ok(dir) => dir, Err(e) => { dir.remove_dir(name).ok();