Skip to content

Commit

Permalink
Fix some clippy lints.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Apr 12, 2023
1 parent 825b1e7 commit f2a2291
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions cap-fs-ext/src/dir_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ impl DirExtUtf8 for cap_std::fs_utf8::Dir {
&self.as_filelike_view::<std::fs::File>(),
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),
}
}
Expand Down Expand Up @@ -1045,7 +1045,7 @@ impl AsyncDirExtUtf8 for cap_async_std::fs_utf8::Dir {
spawn_blocking(move || {
set_times(
&clone.as_filelike_view::<std::fs::File>(),
&path,
path,
Some(atime),
None,
)
Expand All @@ -1064,7 +1064,7 @@ impl AsyncDirExtUtf8 for cap_async_std::fs_utf8::Dir {
spawn_blocking(move || {
set_times(
&clone.as_filelike_view::<std::fs::File>(),
&path,
path,
None,
Some(mtime),
)
Expand All @@ -1084,7 +1084,7 @@ impl AsyncDirExtUtf8 for cap_async_std::fs_utf8::Dir {
spawn_blocking(move || {
set_times(
&clone.as_filelike_view::<std::fs::File>(),
&path,
path,
atime,
mtime,
)
Expand All @@ -1104,7 +1104,7 @@ impl AsyncDirExtUtf8 for cap_async_std::fs_utf8::Dir {
spawn_blocking(move || {
set_times_nofollow(
&clone.as_filelike_view::<std::fs::File>(),
&path,
path,
atime,
mtime,
)
Expand Down
2 changes: 1 addition & 1 deletion cap-net-ext/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down
2 changes: 1 addition & 1 deletion cap-primitives/src/rustix/linux/fs/open_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}
Expand Down
4 changes: 2 additions & 2 deletions cap-tempfile/src/utf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ impl TempDir {
pub fn new_in(dir: &Dir) -> io::Result<Self> {
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();
Expand Down

0 comments on commit f2a2291

Please sign in to comment.