Skip to content

Commit 9e0a16c

Browse files
authored
chore: update clippy (#37)
1 parent 83e0f83 commit 9e0a16c

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

examples/compute.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl ComputeActor {
8989
while let Some(msg) = self.recv.recv().await {
9090
n0_future::task::spawn(async move {
9191
if let Err(cause) = Self::handle(msg).await {
92-
eprintln!("Error: {}", cause);
92+
eprintln!("Error: {cause}");
9393
}
9494
});
9595
}
@@ -271,7 +271,7 @@ async fn local() -> anyhow::Result<()> {
271271
let mut rx = api.fibonacci(10).await?;
272272
print!("Local: Fibonacci up to 10 = ");
273273
while let Some(num) = rx.recv().await? {
274-
print!("{} ", num);
274+
print!("{num} ");
275275
}
276276
println!();
277277

@@ -283,7 +283,7 @@ async fn local() -> anyhow::Result<()> {
283283
drop(in_tx);
284284
print!("Local: 3 * [2, 4, 6] = ");
285285
while let Some(num) = out_rx.recv().await? {
286-
print!("{} ", num);
286+
print!("{num} ");
287287
}
288288
println!();
289289

@@ -322,7 +322,7 @@ async fn remote() -> anyhow::Result<()> {
322322
let mut rx = api.fibonacci(20).await?;
323323
print!("Remote: Fibonacci up to 20 = ");
324324
while let Some(num) = rx.recv().await? {
325-
print!("{} ", num);
325+
print!("{num} ");
326326
}
327327
println!();
328328

@@ -334,7 +334,7 @@ async fn remote() -> anyhow::Result<()> {
334334
drop(in_tx);
335335
print!("Remote: 5 * [1, 2, 3] = ");
336336
while let Some(num) = out_rx.recv().await? {
337-
print!("{} ", num);
337+
print!("{num} ");
338338
}
339339
println!();
340340

examples/derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl StorageApi {
170170
async fn client_demo(api: StorageApi) -> Result<()> {
171171
api.set("hello".to_string(), "world".to_string()).await?;
172172
let value = api.get("hello".to_string()).await?;
173-
println!("get: hello = {:?}", value);
173+
println!("get: hello = {value:?}");
174174

175175
let (tx, rx) = api.set_many().await?;
176176
for i in 0..3 {
@@ -182,7 +182,7 @@ async fn client_demo(api: StorageApi) -> Result<()> {
182182

183183
let mut list = api.list().await?;
184184
while let Some(value) = list.recv().await? {
185-
println!("list value = {:?}", value);
185+
println!("list value = {value:?}");
186186
}
187187
Ok(())
188188
}

examples/storage.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ async fn local() -> anyhow::Result<()> {
196196
let value = api.get("hello".to_string()).await?.await?;
197197
let mut list = api.list().await?;
198198
while let Some(value) = list.recv().await? {
199-
println!("list value = {:?}", value);
199+
println!("list value = {value:?}");
200200
}
201-
println!("value = {:?}", value);
201+
println!("value = {value:?}");
202202
Ok(())
203203
}
204204

@@ -218,10 +218,10 @@ async fn remote() -> anyhow::Result<()> {
218218
.await?
219219
.await?;
220220
let value = api.get("hello".to_string()).await?.await?;
221-
println!("value = {:?}", value);
221+
println!("value = {value:?}");
222222
let mut list = api.list().await?;
223223
while let Some(value) = list.recv().await? {
224-
println!("list value = {:?}", value);
224+
println!("list value = {value:?}");
225225
}
226226
drop(handle);
227227
Ok(())

irpc-derive/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn generate_type_aliases(
128128
for (variant_name, inner_type) in variants {
129129
// Create a type name using the variant name + suffix
130130
// For example: Sum + "Msg" = SumMsg
131-
let type_name = format!("{}{}", variant_name, suffix);
131+
let type_name = format!("{variant_name}{suffix}");
132132
let type_ident = Ident::new(&type_name, variant_name.span());
133133

134134
let alias = quote! {
@@ -392,7 +392,7 @@ impl Parse for MacroArgs {
392392
_ => {
393393
return Err(syn::Error::new(
394394
param_name.span(),
395-
format!("Unknown parameter: {}", param_name),
395+
format!("Unknown parameter: {param_name}"),
396396
));
397397
}
398398
}

irpc-iroh/examples/auth.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ async fn remote() -> Result<()> {
3434
api.set("hello".to_string(), "world".to_string()).await?;
3535
api.set("goodbye".to_string(), "world".to_string()).await?;
3636
let value = api.get("hello".to_string()).await?;
37-
println!("value = {:?}", value);
37+
println!("value = {value:?}");
3838
let mut list = api.list().await?;
3939
while let Some(value) = list.recv().await? {
40-
println!("list value = {:?}", value);
40+
println!("list value = {value:?}");
4141
}
4242

4343
// invalid authentication

irpc-iroh/examples/derive.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ async fn local() -> Result<()> {
1919
let value = api.get("hello".to_string()).await?;
2020
let mut list = api.list().await?;
2121
while let Some(value) = list.recv().await? {
22-
println!("list value = {:?}", value);
22+
println!("list value = {value:?}");
2323
}
24-
println!("value = {:?}", value);
24+
println!("value = {value:?}");
2525
Ok(())
2626
}
2727

@@ -41,10 +41,10 @@ async fn remote() -> Result<()> {
4141
api.set("hello".to_string(), "world".to_string()).await?;
4242
api.set("goodbye".to_string(), "world".to_string()).await?;
4343
let value = api.get("hello".to_string()).await?;
44-
println!("value = {:?}", value);
44+
println!("value = {value:?}");
4545
let mut list = api.list().await?;
4646
while let Some(value) = list.recv().await? {
47-
println!("list value = {:?}", value);
47+
println!("list value = {value:?}");
4848
}
4949
drop(server_router);
5050
Ok(())

tests/mpsc_channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async fn mpsc_sender_clone_closed_error() -> TestResult<()> {
4848
while send1.send(vec![1, 2, 3]).await.is_ok() {}
4949
match send1.send(vec![4, 5, 6]).await {
5050
Err(SendError::Io(e)) if e.kind() == ErrorKind::BrokenPipe => {}
51-
e => panic!("Expected SendError::Io with kind BrokenPipe, got {:?}", e),
51+
e => panic!("Expected SendError::Io with kind BrokenPipe, got {e:?}"),
5252
};
5353
// check that closed signal was received by the second sender
5454
second_client.await?;

tests/oneshot_channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async fn oneshot_serialize_error_send() -> TestResult<()> {
9696
let Err(cause) = server.await? else {
9797
panic!("server should have failed due to serialization error");
9898
};
99-
println!("Server error: {:?}", cause);
99+
println!("Server error: {cause:?}");
100100
assert!(matches!(cause, RecvError::Io(e) if e.kind() == ErrorKind::ConnectionReset));
101101
Ok(())
102102
}
@@ -113,7 +113,7 @@ async fn oneshot_serialize_error_recv() -> TestResult<()> {
113113
let Err(cause) = server.await? else {
114114
panic!("server should have failed due to serialization error");
115115
};
116-
println!("Server error: {:?}", cause);
116+
println!("Server error: {cause:?}");
117117
assert!(matches!(cause, RecvError::Io(e) if e.kind() == ErrorKind::InvalidData));
118118
Ok(())
119119
}

0 commit comments

Comments
 (0)