Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 048e91a

Browse files
committed
Use flush combinator
1 parent 26a17ac commit 048e91a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tokio-postgres/src/cancel_query_raw.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ where
2323
frontend::cancel_request(process_id, secret_key, &mut buf);
2424

2525
stream.write_all(&buf).await.map_err(Error::io)?;
26-
future::poll_fn(|cx| Pin::new(&mut stream).poll_flush(cx))
27-
.await
28-
.map_err(Error::io)?;
26+
stream.flush().await.map_err(Error::io)?;
2927
future::poll_fn(|cx| Pin::new(&mut stream).poll_shutdown(cx))
3028
.await
3129
.map_err(Error::io)?;

0 commit comments

Comments
 (0)