Skip to content

Commit 85b80cf

Browse files
author
Stjepan Glavina
committed
Fuse futures in select!
1 parent 17534cf commit 85b80cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/src/tutorial/implementing_a_client.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ async fn try_run(addr: impl ToSocketAddrs) -> Result<()> {
3939
let mut lines_from_stdin = BufReader::new(stdin()).lines().fuse(); // 2
4040
loop {
4141
select! { // 3
42-
line = lines_from_server.next() => match line {
42+
line = lines_from_server.next().fuse() => match line {
4343
Some(line) => {
4444
let line = line?;
4545
println!("{}", line);
4646
},
4747
None => break,
4848
},
49-
line = lines_from_stdin.next() => match line {
49+
line = lines_from_stdin.next().fuse() => match line {
5050
Some(line) => {
5151
let line = line?;
5252
writer.write_all(line.as_bytes()).await?;

0 commit comments

Comments
 (0)