From de901045127e41b206c99e9bc536f64f5feef511 Mon Sep 17 00:00:00 2001 From: clemensw Date: Fri, 23 Aug 2019 22:49:41 +0200 Subject: [PATCH] Select wants a FusedFuture --- docs/src/tutorial/handling_disconnection.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/tutorial/handling_disconnection.md b/docs/src/tutorial/handling_disconnection.md index 4cda69fd..2fbfa156 100644 --- a/docs/src/tutorial/handling_disconnection.md +++ b/docs/src/tutorial/handling_disconnection.md @@ -219,11 +219,11 @@ async fn broker(mut events: Receiver) { loop { let event = select! { - event = events.next() => match event { + event = events.next().fuse() => match event { None => break, // 2 Some(event) => event, }, - disconnect = disconnect_receiver.next() => { + disconnect = disconnect_receiver.next().fuse() => { let (name, _pending_messages) = disconnect.unwrap(); // 3 assert!(peers.remove(&name).is_some()); continue;