Skip to content

Commit f9c2fab

Browse files
authored
chore: ignore unhelpful lint (#301)
This is here for destructor reasons. This lint is incorrect and unhelpful.
1 parent a69d4bf commit f9c2fab

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
lines changed

examples/cat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ fn main() {
4343
}
4444

4545
// Include a new line
46-
println!("");
46+
println!();
4747
});
4848
}

examples/tcp_listener.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn main() {
3838
}
3939

4040
let (res, slice) = stream.write_all(buf.slice(..read)).await;
41-
let _ = res.unwrap();
41+
res.unwrap();
4242
buf = slice.into_inner();
4343
println!("{} all {} bytes ping-ponged", socket_addr, read);
4444
n += read;

examples/tcp_listener_fixed_buffers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async fn echo_handler<T: IoBufMut>(
8989

9090
let (res, nslice) = stream.write_fixed_all(fbuf1.slice(..read)).await;
9191

92-
let _ = res.unwrap();
92+
res.unwrap();
9393
println!("peer {} all {} bytes ping-ponged", peer, read);
9494
n += read;
9595

examples/wrk-bench.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use std::io;
22
use std::rc::Rc;
33
use tokio::task::JoinHandle;
44

5-
pub const RESPONSE: &'static [u8] =
5+
pub const RESPONSE: &[u8] =
66
b"HTTP/1.1 200 OK\nContent-Type: text/plain\nContent-Length: 12\n\nHello world!";
77

8-
pub const ADDRESS: &'static str = "127.0.0.1:8080";
8+
pub const ADDRESS: &str = "127.0.0.1:8080";
99

1010
fn main() -> io::Result<()> {
1111
tokio_uring::start(async {

src/io/accept.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl Completable for Accept {
4747
let socket = Socket { fd };
4848
let (_, addr) = unsafe {
4949
socket2::SockAddr::init(move |addr_storage, len| {
50-
*addr_storage = self.socketaddr.0.to_owned();
50+
self.socketaddr.0.clone_into(&mut *addr_storage);
5151
*len = self.socketaddr.1;
5252
Ok(())
5353
})?

src/io/shared_fd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl SharedFd {
9494
}
9595
State::WaitingForUniqueness(waker) => {
9696
if !waker.will_wake(cx.waker()) {
97-
*waker = cx.waker().clone();
97+
waker.clone_from(cx.waker());
9898
}
9999

100100
Poll::Pending

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
//! call `close()`.
5858
5959
#![warn(missing_docs)]
60+
#![allow(clippy::thread_local_initializer_can_be_made_const)]
6061

6162
macro_rules! syscall {
6263
($fn: ident ( $($arg: expr),* $(,)* ) ) => {{

src/runtime/driver/op/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ pub(crate) trait Updateable: Completable {
156156
fn update(&mut self, cqe: CqeResult);
157157
}
158158

159+
#[allow(dead_code)]
159160
pub(crate) enum Lifecycle {
160161
/// The operation has been submitted to uring and is currently in-flight
161162
Submitted,

tests/fs_file.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ use std::{
33
os::unix::io::{AsRawFd, FromRawFd, RawFd},
44
};
55

6-
use libc;
7-
86
use tempfile::NamedTempFile;
97

108
use tokio_uring::buf::fixed::FixedBufRegistry;

0 commit comments

Comments
 (0)