diff options
| author | Nick Mathewson <nickm@torproject.org> | 2021-12-27 11:17:17 -0500 |
|---|---|---|
| committer | Nick Mathewson <nickm@torproject.org> | 2021-12-31 12:10:59 -0500 |
| commit | 65d1f83d2c593c7997b4fe781814eb0fb69272e9 (patch) | |
| tree | d65958351faa99a53291071590c77c1f3910455f /tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.panic-unwind.diff | |
| parent | 0eff589afc83e21a03a168497bbab6b4dfbb4ef6 (diff) | |
| download | rust-65d1f83d2c593c7997b4fe781814eb0fb69272e9.tar.gz rust-65d1f83d2c593c7997b4fe781814eb0fb69272e9.zip | |
Extend [`unused_io_amount`] to cover AsyncRead and AsyncWrite.
Clippy helpfully warns about code like this, telling you that you
probably meant "write_all":
fn say_hi<W:Write>(w: &mut W) {
w.write(b"hello").unwrap();
}
This patch attempts to extend the lint so it also covers this
case:
async fn say_hi<W:AsyncWrite>(w: &mut W) {
w.write(b"hello").await.unwrap();
}
(I've run into this second case several times in my own programming,
and so have my coworkers, so unless we're especially accident-prone
in this area, it's probably worth addressing?)
This patch covers the Async{Read,Write}Ext traits in futures-rs,
and in tokio, since both are quite widely used.
changelog: [`unused_io_amount`] now supports AsyncReadExt and AsyncWriteExt.
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_bound_mut.NormalizeArrayLen.panic-unwind.diff')
0 files changed, 0 insertions, 0 deletions
