diff --git a/cap-async-std/src/fs/file.rs b/cap-async-std/src/fs/file.rs index 29a03a15..e626004b 100644 --- a/cap-async-std/src/fs/file.rs +++ b/cap-async-std/src/fs/file.rs @@ -121,7 +121,7 @@ impl File { spawn_blocking(move || { open_ambient( path.as_ref(), - &OpenOptions::new().read(true), + OpenOptions::new().read(true), ambient_authority, ) }) diff --git a/cap-primitives/src/rustix/fs/copy_impl.rs b/cap-primitives/src/rustix/fs/copy_impl.rs index 46d5cb9d..1b661ae2 100644 --- a/cap-primitives/src/rustix/fs/copy_impl.rs +++ b/cap-primitives/src/rustix/fs/copy_impl.rs @@ -128,7 +128,7 @@ pub(crate) fn copy_impl( } copy_result } else { - Err(rustix::io::Errno::NOSYS.into()) + Err(rustix::io::Errno::NOSYS) }; match copy_result { Ok(ret) => written += ret as u64, diff --git a/cap-primitives/src/rustix/fs/read_dir_inner.rs b/cap-primitives/src/rustix/fs/read_dir_inner.rs index a3bfb09f..44f248a1 100644 --- a/cap-primitives/src/rustix/fs/read_dir_inner.rs +++ b/cap-primitives/src/rustix/fs/read_dir_inner.rs @@ -104,7 +104,8 @@ impl Iterator for ReadDirInner { fn next(&mut self) -> Option { loop { - let entry = match self.rustix.lock().unwrap().0.read()? { + let entry = self.rustix.lock().unwrap().0.read()?; + let entry = match entry { Ok(entry) => entry, Err(e) => return Some(Err(e.into())), }; diff --git a/cap-primitives/src/rustix/linux/fs/open_impl.rs b/cap-primitives/src/rustix/linux/fs/open_impl.rs index 9c14078f..793b77b0 100644 --- a/cap-primitives/src/rustix/linux/fs/open_impl.rs +++ b/cap-primitives/src/rustix/linux/fs/open_impl.rs @@ -122,12 +122,12 @@ pub(crate) fn open_beneath( break; } - _ => return Err(err.into()), + _ => return Err(err), }, } } - Err(rustix::io::Errno::NOSYS.into()) + Err(rustix::io::Errno::NOSYS) }) .map_err(|err| match err { rustix::io::Errno::XDEV => errors::escape_attempt(), diff --git a/cap-std/src/fs/file.rs b/cap-std/src/fs/file.rs index 8a29717c..3a694469 100644 --- a/cap-std/src/fs/file.rs +++ b/cap-std/src/fs/file.rs @@ -123,7 +123,7 @@ impl File { ) -> io::Result { let std = open_ambient( path.as_ref(), - &OpenOptions::new().read(true), + OpenOptions::new().read(true), ambient_authority, )?; Ok(Self::from_std(std)) diff --git a/cap-std/src/fs_utf8/mod.rs b/cap-std/src/fs_utf8/mod.rs index d8b63a66..daf2f7da 100644 --- a/cap-std/src/fs_utf8/mod.rs +++ b/cap-std/src/fs_utf8/mod.rs @@ -61,7 +61,7 @@ fn to_utf8>(path: P) -> std::io::Result { #[cfg(not(windows))] { Ok(Utf8Path::from_path(path.as_ref()) - .ok_or_else(|| ::rustix::io::Errno::ILSEQ)? + .ok_or(::rustix::io::Errno::ILSEQ)? .to_path_buf()) } diff --git a/cap-tempfile/src/tempfile.rs b/cap-tempfile/src/tempfile.rs index a4bb7f4c..77472085 100644 --- a/cap-tempfile/src/tempfile.rs +++ b/cap-tempfile/src/tempfile.rs @@ -158,7 +158,7 @@ impl<'d> TempFile<'d> { // But, if we catch an error here, then move ownership back into self, // which means the Drop invocation will clean it up. self.name = Some(tempname); - e.into() + e }) }