Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/fs/create_dir_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl DirBuilder {
// recursion when only the first level of the directory needs to be built. For now, this serves
// its purpose.

fn recurse_create_dir_all<'a>(&'a self, path: &'a Path) -> LocalBoxFuture<io::Result<()>> {
fn recurse_create_dir_all<'a>(&'a self, path: &'a Path) -> LocalBoxFuture<'a, io::Result<()>> {
Box::pin(async move {
if path == Path::new("") {
return Ok(());
Expand All @@ -139,10 +139,7 @@ impl DirBuilder {
match path.parent() {
Some(p) => self.recurse_create_dir_all(p).await?,
None => {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
"failed to create whole tree",
));
return Err(std::io::Error::other("failed to create whole tree"));
/* TODO build own allocation free error some day like the std library does.
return Err(io::const_io_error!(
io::ErrorKind::Uncategorized,
Expand Down
6 changes: 3 additions & 3 deletions src/fs/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ impl File {
"failed to fill whole buffer",
)),
slice.into_inner(),
)
);
}
Ok(n) => {
pos += n as u64;
Expand Down Expand Up @@ -618,7 +618,7 @@ impl File {
"failed to write whole buffer",
)),
slice.into_inner(),
)
);
}
Ok(n) => {
pos += n as u64;
Expand Down Expand Up @@ -738,7 +738,7 @@ impl File {
"failed to write whole buffer",
)),
slice.into_inner(),
)
);
}
Ok(n) => {
pos += n as u64;
Expand Down
4 changes: 2 additions & 2 deletions src/io/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Socket {
"failed to write whole buffer",
)),
slice.into_inner(),
)
);
}
(Ok(n), slice) => {
buf = slice.slice(n..);
Expand Down Expand Up @@ -112,7 +112,7 @@ impl Socket {
"failed to write whole buffer",
)),
slice.into_inner(),
)
);
}
(Ok(n), slice) => {
buf = slice.slice(n..);
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
//! call `close()`.

#![warn(missing_docs)]
#![allow(clippy::thread_local_initializer_can_be_made_const)]
#![allow(clippy::missing_const_for_thread_local)]

macro_rules! syscall {
($fn: ident ( $($arg: expr),* $(,)* ) ) => {{
Expand Down
5 changes: 2 additions & 3 deletions src/net/tcp/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,8 @@ impl TcpListener {
pub async fn accept(&self) -> io::Result<(TcpStream, SocketAddr)> {
let (socket, socket_addr) = self.inner.accept().await?;
let stream = TcpStream { inner: socket };
let socket_addr = socket_addr.ok_or_else(|| {
io::Error::new(io::ErrorKind::Other, "Could not get socket IP address")
})?;
let socket_addr =
socket_addr.ok_or_else(|| io::Error::other("Could not get socket IP address"))?;
Ok((stream, socket_addr))
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/runtime/driver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ impl Driver {
return Ok(());
}
}
Err(io::Error::new(
io::ErrorKind::Other,
Err(io::Error::other(
"fixed buffers are not currently registered",
))
}
Expand Down
Loading