182: Fix compilation errors on latest nightly r=yoshuawuyts a=stjepang



Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
pull/184/head
bors[bot] 5 years ago committed by GitHub
commit a296760119
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -115,7 +115,8 @@ async fn broker(mut events: Receiver<Event>) -> Result<()> {
Event::Message { from, to, msg } => {
for addr in to {
if let Some(peer) = peers.get_mut(&addr) {
peer.send(format!("from {}: {}\n", from, msg)).await?
let msg = format!("from {}: {}\n", from, msg);
peer.send(msg).await?
}
}
}

@ -115,7 +115,8 @@ Let's add waiting to the server:
# Event::Message { from, to, msg } => {
# for addr in to {
# if let Some(peer) = peers.get_mut(&addr) {
# peer.send(format!("from {}: {}\n", from, msg)).await?
# let msg = format!("from {}: {}\n", from, msg);
# peer.send(msg).await?
# }
# }
# }
@ -217,7 +218,8 @@ async fn broker(mut events: Receiver<Event>) -> Result<()> {
Event::Message { from, to, msg } => {
for addr in to {
if let Some(peer) = peers.get_mut(&addr) {
peer.send(format!("from {}: {}\n", from, msg)).await?
let msg = format!("from {}: {}\n", from, msg);
peer.send(msg).await?
}
}
}

@ -73,7 +73,8 @@ async fn broker(mut events: Receiver<Event>) -> Result<()> {
Event::Message { from, to, msg } => { // 3
for addr in to {
if let Some(peer) = peers.get_mut(&addr) {
peer.send(format!("from {}: {}\n", from, msg)).await?
let msg = format!("from {}: {}\n", from, msg);
peer.send(msg).await?
}
}
}

@ -257,7 +257,8 @@ async fn broker(events: Receiver<Event>) {
Event::Message { from, to, msg } => {
for addr in to {
if let Some(peer) = peers.get_mut(&addr) {
peer.send(format!("from {}: {}\n", from, msg)).await
let msg = format!("from {}: {}\n", from, msg);
peer.send(msg).await
.unwrap() // 6
}
}

@ -139,9 +139,8 @@ async fn broker_loop(mut events: Receiver<Event>) {
Event::Message { from, to, msg } => {
for addr in to {
if let Some(peer) = peers.get_mut(&addr) {
peer.send(format!("from {}: {}\n", from, msg))
.await
.unwrap()
let msg = format!("from {}: {}\n", from, msg);
peer.send(msg).await.unwrap();
}
}
}

@ -10,7 +10,7 @@ async fn get() -> io::Result<Vec<u8>> {
let mut buf = vec![];
io::timeout(Duration::from_secs(5), async {
io::timeout(Duration::from_secs(5), async move {
stream.read_to_end(&mut buf).await?;
Ok(buf)
})

Loading…
Cancel
Save