diff --git a/examples/cat.rs b/examples/cat.rs index d41b7ab1..c94c8090 100644 --- a/examples/cat.rs +++ b/examples/cat.rs @@ -43,6 +43,6 @@ fn main() { } // Include a new line - println!(""); + println!(); }); } diff --git a/examples/tcp_listener.rs b/examples/tcp_listener.rs index 918503ca..3121f406 100644 --- a/examples/tcp_listener.rs +++ b/examples/tcp_listener.rs @@ -38,7 +38,7 @@ fn main() { } let (res, slice) = stream.write_all(buf.slice(..read)).await; - let _ = res.unwrap(); + res.unwrap(); buf = slice.into_inner(); println!("{} all {} bytes ping-ponged", socket_addr, read); n += read; diff --git a/examples/tcp_listener_fixed_buffers.rs b/examples/tcp_listener_fixed_buffers.rs index 69db2c8e..30faaeae 100644 --- a/examples/tcp_listener_fixed_buffers.rs +++ b/examples/tcp_listener_fixed_buffers.rs @@ -89,7 +89,7 @@ async fn echo_handler( let (res, nslice) = stream.write_fixed_all(fbuf1.slice(..read)).await; - let _ = res.unwrap(); + res.unwrap(); println!("peer {} all {} bytes ping-ponged", peer, read); n += read; diff --git a/examples/wrk-bench.rs b/examples/wrk-bench.rs index 222df76a..3b4905fc 100644 --- a/examples/wrk-bench.rs +++ b/examples/wrk-bench.rs @@ -2,10 +2,10 @@ use std::io; use std::rc::Rc; use tokio::task::JoinHandle; -pub const RESPONSE: &'static [u8] = +pub const RESPONSE: &[u8] = b"HTTP/1.1 200 OK\nContent-Type: text/plain\nContent-Length: 12\n\nHello world!"; -pub const ADDRESS: &'static str = "127.0.0.1:8080"; +pub const ADDRESS: &str = "127.0.0.1:8080"; fn main() -> io::Result<()> { tokio_uring::start(async { diff --git a/src/io/accept.rs b/src/io/accept.rs index 17f8f88f..d4e19d58 100644 --- a/src/io/accept.rs +++ b/src/io/accept.rs @@ -47,7 +47,7 @@ impl Completable for Accept { let socket = Socket { fd }; let (_, addr) = unsafe { socket2::SockAddr::init(move |addr_storage, len| { - *addr_storage = self.socketaddr.0.to_owned(); + self.socketaddr.0.clone_into(&mut *addr_storage); *len = self.socketaddr.1; Ok(()) })? diff --git a/src/io/shared_fd.rs b/src/io/shared_fd.rs index e3423238..0636fc46 100644 --- a/src/io/shared_fd.rs +++ b/src/io/shared_fd.rs @@ -94,7 +94,7 @@ impl SharedFd { } State::WaitingForUniqueness(waker) => { if !waker.will_wake(cx.waker()) { - *waker = cx.waker().clone(); + waker.clone_from(cx.waker()); } Poll::Pending diff --git a/src/lib.rs b/src/lib.rs index d1cc6e02..819eebf7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -57,6 +57,7 @@ //! call `close()`. #![warn(missing_docs)] +#![allow(clippy::thread_local_initializer_can_be_made_const)] macro_rules! syscall { ($fn: ident ( $($arg: expr),* $(,)* ) ) => {{ diff --git a/src/runtime/driver/op/mod.rs b/src/runtime/driver/op/mod.rs index 32ba3e7a..5d90daaf 100644 --- a/src/runtime/driver/op/mod.rs +++ b/src/runtime/driver/op/mod.rs @@ -156,6 +156,7 @@ pub(crate) trait Updateable: Completable { fn update(&mut self, cqe: CqeResult); } +#[allow(dead_code)] pub(crate) enum Lifecycle { /// The operation has been submitted to uring and is currently in-flight Submitted, diff --git a/tests/fs_file.rs b/tests/fs_file.rs index 6ec14d43..096565e6 100644 --- a/tests/fs_file.rs +++ b/tests/fs_file.rs @@ -3,8 +3,6 @@ use std::{ os::unix::io::{AsRawFd, FromRawFd, RawFd}, }; -use libc; - use tempfile::NamedTempFile; use tokio_uring::buf::fixed::FixedBufRegistry;