Skip to content
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
10 changes: 5 additions & 5 deletions examples/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl ComputeActor {
while let Some(msg) = self.recv.recv().await {
n0_future::task::spawn(async move {
if let Err(cause) = Self::handle(msg).await {
eprintln!("Error: {}", cause);
eprintln!("Error: {cause}");
}
});
}
Expand Down Expand Up @@ -271,7 +271,7 @@ async fn local() -> anyhow::Result<()> {
let mut rx = api.fibonacci(10).await?;
print!("Local: Fibonacci up to 10 = ");
while let Some(num) = rx.recv().await? {
print!("{} ", num);
print!("{num} ");
}
println!();

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions examples/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl StorageApi {
async fn client_demo(api: StorageApi) -> Result<()> {
api.set("hello".to_string(), "world".to_string()).await?;
let value = api.get("hello".to_string()).await?;
println!("get: hello = {:?}", value);
println!("get: hello = {value:?}");

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

let mut list = api.list().await?;
while let Some(value) = list.recv().await? {
println!("list value = {:?}", value);
println!("list value = {value:?}");
}
Ok(())
}
Expand Down
8 changes: 4 additions & 4 deletions examples/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ async fn local() -> anyhow::Result<()> {
let value = api.get("hello".to_string()).await?.await?;
let mut list = api.list().await?;
while let Some(value) = list.recv().await? {
println!("list value = {:?}", value);
println!("list value = {value:?}");
}
println!("value = {:?}", value);
println!("value = {value:?}");
Ok(())
}

Expand All @@ -218,10 +218,10 @@ async fn remote() -> anyhow::Result<()> {
.await?
.await?;
let value = api.get("hello".to_string()).await?.await?;
println!("value = {:?}", value);
println!("value = {value:?}");
let mut list = api.list().await?;
while let Some(value) = list.recv().await? {
println!("list value = {:?}", value);
println!("list value = {value:?}");
}
drop(handle);
Ok(())
Expand Down
4 changes: 2 additions & 2 deletions irpc-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ fn generate_type_aliases(
for (variant_name, inner_type) in variants {
// Create a type name using the variant name + suffix
// For example: Sum + "Msg" = SumMsg
let type_name = format!("{}{}", variant_name, suffix);
let type_name = format!("{variant_name}{suffix}");
let type_ident = Ident::new(&type_name, variant_name.span());

let alias = quote! {
Expand Down Expand Up @@ -392,7 +392,7 @@ impl Parse for MacroArgs {
_ => {
return Err(syn::Error::new(
param_name.span(),
format!("Unknown parameter: {}", param_name),
format!("Unknown parameter: {param_name}"),
));
}
}
Expand Down
4 changes: 2 additions & 2 deletions irpc-iroh/examples/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ async fn remote() -> Result<()> {
api.set("hello".to_string(), "world".to_string()).await?;
api.set("goodbye".to_string(), "world".to_string()).await?;
let value = api.get("hello".to_string()).await?;
println!("value = {:?}", value);
println!("value = {value:?}");
let mut list = api.list().await?;
while let Some(value) = list.recv().await? {
println!("list value = {:?}", value);
println!("list value = {value:?}");
}

// invalid authentication
Expand Down
8 changes: 4 additions & 4 deletions irpc-iroh/examples/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ async fn local() -> Result<()> {
let value = api.get("hello".to_string()).await?;
let mut list = api.list().await?;
while let Some(value) = list.recv().await? {
println!("list value = {:?}", value);
println!("list value = {value:?}");
}
println!("value = {:?}", value);
println!("value = {value:?}");
Ok(())
}

Expand All @@ -41,10 +41,10 @@ async fn remote() -> Result<()> {
api.set("hello".to_string(), "world".to_string()).await?;
api.set("goodbye".to_string(), "world".to_string()).await?;
let value = api.get("hello".to_string()).await?;
println!("value = {:?}", value);
println!("value = {value:?}");
let mut list = api.list().await?;
while let Some(value) = list.recv().await? {
println!("list value = {:?}", value);
println!("list value = {value:?}");
}
drop(server_router);
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion tests/mpsc_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async fn mpsc_sender_clone_closed_error() -> TestResult<()> {
while send1.send(vec![1, 2, 3]).await.is_ok() {}
match send1.send(vec![4, 5, 6]).await {
Err(SendError::Io(e)) if e.kind() == ErrorKind::BrokenPipe => {}
e => panic!("Expected SendError::Io with kind BrokenPipe, got {:?}", e),
e => panic!("Expected SendError::Io with kind BrokenPipe, got {e:?}"),
};
// check that closed signal was received by the second sender
second_client.await?;
Expand Down
4 changes: 2 additions & 2 deletions tests/oneshot_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async fn oneshot_serialize_error_send() -> TestResult<()> {
let Err(cause) = server.await? else {
panic!("server should have failed due to serialization error");
};
println!("Server error: {:?}", cause);
println!("Server error: {cause:?}");
assert!(matches!(cause, RecvError::Io(e) if e.kind() == ErrorKind::ConnectionReset));
Ok(())
}
Expand All @@ -113,7 +113,7 @@ async fn oneshot_serialize_error_recv() -> TestResult<()> {
let Err(cause) = server.await? else {
panic!("server should have failed due to serialization error");
};
println!("Server error: {:?}", cause);
println!("Server error: {cause:?}");
assert!(matches!(cause, RecvError::Io(e) if e.kind() == ErrorKind::InvalidData));
Ok(())
}
Loading