Skip to content

Commit 75bc736

Browse files
committed
fix: Correct clippy lints for string formatted variable usage
1 parent 5c4f1bc commit 75bc736

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

examples/tcp_listener.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn main() {
2424

2525
use tokio_uring::buf::BoundedBuf; // for slice()
2626

27-
println!("{} connected", socket_addr);
27+
println!("{socket_addr} connected");
2828
let mut n = 0;
2929

3030
let mut buf = vec![0u8; 4096];
@@ -33,14 +33,14 @@ fn main() {
3333
buf = nbuf;
3434
let read = result.unwrap();
3535
if read == 0 {
36-
println!("{} closed, {} total ping-ponged", socket_addr, n);
36+
println!("{socket_addr} closed, {n} total ping-ponged");
3737
break;
3838
}
3939

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

examples/tcp_listener_fixed_buffers.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async fn echo_handler<T: IoBufMut>(
5555
peer: SocketAddr,
5656
registry: FixedBufRegistry<T>,
5757
) {
58-
println!("peer {} connected", peer);
58+
println!("peer {peer} connected");
5959

6060
// Get one of the two fixed buffers.
6161
// If neither is unavailable, print reason and return immediately, dropping this connection;
@@ -68,7 +68,7 @@ async fn echo_handler<T: IoBufMut>(
6868
};
6969
if fbuf.is_none() {
7070
let _ = stream.shutdown(std::net::Shutdown::Write);
71-
println!("peer {} closed, no fixed buffers available", peer);
71+
println!("peer {peer} closed, no fixed buffers available");
7272
return;
7373
};
7474

@@ -90,13 +90,13 @@ async fn echo_handler<T: IoBufMut>(
9090
let (res, nslice) = stream.write_fixed_all(fbuf1.slice(..read)).await;
9191

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

9696
// Important. One of the points of this example.
9797
nslice.into_inner() // Return the buffer we started with.
9898
};
9999
}
100100
let _ = stream.shutdown(std::net::Shutdown::Write);
101-
println!("peer {} closed, {} total ping-ponged", peer, n);
101+
println!("peer {peer} closed, {n} total ping-ponged");
102102
}

examples/test_create_dir_all.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ async fn is_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
246246
fn main() {
247247
tokio_uring::start(async {
248248
if let Err(e) = main1().await {
249-
println!("error: {}", e);
249+
println!("error: {e}");
250250
}
251251
});
252252
}

examples/wrk-bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn main() -> io::Result<()> {
2424
let (result, _) = stream.write(RESPONSE).submit().await;
2525

2626
if let Err(err) = result {
27-
eprintln!("Client connection failed: {}", err);
27+
eprintln!("Client connection failed: {err}");
2828
}
2929
});
3030
}

tests/fixed_buf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ fn pool_next_as_concurrency_limit() {
183183
mem::drop(file);
184184
let mut content = String::new();
185185
tempfile.read_to_string(&mut content).unwrap();
186-
println!("{}", content);
186+
println!("{content}");
187187
})
188188
}
189189

0 commit comments

Comments
 (0)