Skip to content

Commit 526e895

Browse files
committed
Fix clippy and run rustfmt
1 parent 7761222 commit 526e895

Some content is hidden

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

42 files changed

+70
-74
lines changed

src/buf/fixed/plumbing/pool.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use crate::buf::fixed::{handle::CheckedOutBuf, FixedBuffers};
21
use crate::buf::IoBufMut;
2+
use crate::buf::fixed::{FixedBuffers, handle::CheckedOutBuf};
33

4-
use libc::{iovec, UIO_MAXIOV};
4+
use libc::{UIO_MAXIOV, iovec};
55
use tokio::sync::Notify;
66

77
use std::cmp;

src/buf/fixed/plumbing/registry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use crate::buf::fixed::{handle::CheckedOutBuf, FixedBuffers};
21
use crate::buf::IoBufMut;
2+
use crate::buf::fixed::{FixedBuffers, handle::CheckedOutBuf};
33

4-
use libc::{iovec, UIO_MAXIOV};
4+
use libc::{UIO_MAXIOV, iovec};
55
use std::cmp;
66
use std::mem;
77
use std::ptr;

src/buf/fixed/pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
//!
99
//! [`FixedBufPool`]: self::FixedBufPool
1010
11-
use super::plumbing;
1211
use super::FixedBuf;
12+
use super::plumbing;
1313
use crate::buf::IoBufMut;
1414
use crate::runtime::CONTEXT;
1515

src/buf/fixed/registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use super::plumbing;
21
use super::FixedBuf;
2+
use super::plumbing;
33

44
use crate::buf::IoBufMut;
55
use crate::runtime::CONTEXT;

src/fs/create_dir_all.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl DirBuilder {
124124
// recursion when only the first level of the directory needs to be built. For now, this serves
125125
// its purpose.
126126

127-
fn recurse_create_dir_all<'a>(&'a self, path: &'a Path) -> LocalBoxFuture<io::Result<()>> {
127+
fn recurse_create_dir_all<'a>(&'a self, path: &'a Path) -> LocalBoxFuture<'a, io::Result<()>> {
128128
Box::pin(async move {
129129
if path == Path::new("") {
130130
return Ok(());
@@ -139,10 +139,7 @@ impl DirBuilder {
139139
match path.parent() {
140140
Some(p) => self.recurse_create_dir_all(p).await?,
141141
None => {
142-
return Err(std::io::Error::new(
143-
std::io::ErrorKind::Other,
144-
"failed to create whole tree",
145-
));
142+
return Err(std::io::Error::other("failed to create whole tree"));
146143
/* TODO build own allocation free error some day like the std library does.
147144
return Err(io::const_io_error!(
148145
io::ErrorKind::Uncategorized,

src/fs/file.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ impl File {
426426
"failed to fill whole buffer",
427427
)),
428428
slice.into_inner(),
429-
)
429+
);
430430
}
431431
Ok(n) => {
432432
pos += n as u64;
@@ -618,7 +618,7 @@ impl File {
618618
"failed to write whole buffer",
619619
)),
620620
slice.into_inner(),
621-
)
621+
);
622622
}
623623
Ok(n) => {
624624
pos += n as u64;
@@ -738,7 +738,7 @@ impl File {
738738
"failed to write whole buffer",
739739
)),
740740
slice.into_inner(),
741-
)
741+
);
742742
}
743743
Ok(n) => {
744744
pos += n as u64;

src/fs/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ pub use directory::create_dir;
55
pub use directory::remove_dir;
66

77
mod create_dir_all;
8-
pub use create_dir_all::create_dir_all;
98
pub use create_dir_all::DirBuilder;
9+
pub use create_dir_all::create_dir_all;
1010

1111
mod file;
12+
pub use file::File;
1213
pub use file::remove_file;
1314
pub use file::rename;
14-
pub use file::File;
1515

1616
mod open_options;
1717
pub use open_options::OpenOptions;
1818

1919
mod statx;
20+
pub use statx::StatxBuilder;
2021
pub use statx::is_dir_regfile;
2122
pub use statx::statx;
22-
pub use statx::StatxBuilder;
2323

2424
mod symlink;
2525
pub use symlink::symlink;

src/fs/statx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::File;
2-
use crate::io::{cstr, SharedFd};
2+
use crate::io::{SharedFd, cstr};
33
use crate::runtime::driver::op::Op;
44
use std::{ffi::CString, io, path::Path};
55

src/io/accept.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::io::{SharedFd, Socket};
2+
use crate::runtime::CONTEXT;
23
use crate::runtime::driver::op;
34
use crate::runtime::driver::op::{Completable, Op};
4-
use crate::runtime::CONTEXT;
55
use std::net::SocketAddr;
66
use std::{boxed::Box, io};
77

src/io/close.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use crate::runtime::CONTEXT;
12
use crate::runtime::driver::op;
23
use crate::runtime::driver::op::{Completable, Op};
3-
use crate::runtime::CONTEXT;
44
use std::io;
55
use std::os::unix::io::RawFd;
66

0 commit comments

Comments
 (0)