Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: ignore unhelpful lint #301

Merged
merged 2 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion examples/cat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ fn main() {
}

// Include a new line
println!("");
println!();
});
}
2 changes: 1 addition & 1 deletion examples/tcp_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion examples/tcp_listener_fixed_buffers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async fn echo_handler<T: IoBufMut>(

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;

Expand Down
4 changes: 2 additions & 2 deletions examples/wrk-bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/io/accept.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
})?
Expand Down
2 changes: 1 addition & 1 deletion src/io/shared_fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),* $(,)* ) ) => {{
Expand Down
1 change: 1 addition & 0 deletions src/runtime/driver/op/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions tests/fs_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ use std::{
os::unix::io::{AsRawFd, FromRawFd, RawFd},
};

use libc;

use tempfile::NamedTempFile;

use tokio_uring::buf::fixed::FixedBufRegistry;
Expand Down