mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-29 00:00:11 +02:00
Fixed typos in examples (#2231)
This commit is contained in:
+3
-3
@@ -71,7 +71,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
// Spawn our handler to be run asynchronously.
|
// Spawn our handler to be run asynchronously.
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
if let Err(e) = process(state, stream, addr).await {
|
if let Err(e) = process(state, stream, addr).await {
|
||||||
println!("an error occured; error = {:?}", e);
|
println!("an error occurred; error = {:?}", e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ impl Stream for Peer {
|
|||||||
// We've received a message we should broadcast to others.
|
// We've received a message we should broadcast to others.
|
||||||
Some(Ok(message)) => Some(Ok(Message::Broadcast(message))),
|
Some(Ok(message)) => Some(Ok(Message::Broadcast(message))),
|
||||||
|
|
||||||
// An error occured.
|
// An error occurred.
|
||||||
Some(Err(e)) => Some(Err(e)),
|
Some(Err(e)) => Some(Err(e)),
|
||||||
|
|
||||||
// The stream has been exhausted.
|
// The stream has been exhausted.
|
||||||
@@ -236,7 +236,7 @@ async fn process(
|
|||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!(
|
println!(
|
||||||
"an error occured while processing messages for {}; error = {:?}",
|
"an error occurred while processing messages for {}; error = {:?}",
|
||||||
username, e
|
username, e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
|
|
||||||
// Run both futures simultaneously of `a` and `b` sending messages back and forth.
|
// Run both futures simultaneously of `a` and `b` sending messages back and forth.
|
||||||
match futures::future::try_join(a, b).await {
|
match futures::future::try_join(a, b).await {
|
||||||
Err(e) => println!("an error occured; error = {:?}", e),
|
Err(e) => println!("an error occurred; error = {:?}", e),
|
||||||
_ => println!("done!"),
|
_ => println!("done!"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user