rust/clippy_utils/src
Nick Mathewson 65d1f83d2c 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.
2021-12-31 12:10:59 -05:00
..
ast_utils
ast_utils.rs Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyup 2021-12-06 12:33:31 +01:00
attrs.rs Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
comparisons.rs
consts.rs Merge remote-tracking branch 'upstream/master' into rustup 2021-12-30 14:17:53 +01:00
diagnostics.rs Merge commit 'e18101137866b79045fee0ef996e696e68c920b4' into clippyup 2021-11-04 12:52:36 +00:00
eager_or_lazy.rs Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
higher.rs Auto merge of #89841 - cormacrelf:let-else-typed, r=nagisa 2021-12-17 22:12:34 +00:00
hir_utils.rs Auto merge of #89841 - cormacrelf:let-else-typed, r=nagisa 2021-12-17 22:12:34 +00:00
lib.rs Merge remote-tracking branch 'upstream/master' into rustup 2021-12-30 14:17:53 +01:00
msrvs.rs Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyup 2021-12-06 12:33:31 +01:00
numeric_literal.rs Merge commit 'b7f3f7f6082679da2da9a0b3faf1b5adef3afd3b' into clippyup 2021-10-07 11:21:30 +02:00
paths.rs Extend [unused_io_amount] to cover AsyncRead and AsyncWrite. 2021-12-31 12:10:59 -05:00
ptr.rs Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyup 2021-12-06 12:33:31 +01:00
qualify_min_const_fn.rs Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
source.rs Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyup 2021-12-06 12:33:31 +01:00
str_utils.rs Some minor cleanup 2021-12-25 21:55:20 +08:00
sugg.rs Use helper functions in ``Sugg`` tests. 2021-12-25 00:29:30 +09:00
sym_helper.rs
ty.rs Merge commit '23d11428de3e973b34a5090a78d62887f821c90e' into clippyup 2021-12-17 13:40:22 +01:00
usage.rs Merge commit '23d11428de3e973b34a5090a78d62887f821c90e' into clippyup 2021-12-17 13:40:22 +01:00
visitors.rs Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyup 2021-12-06 12:33:31 +01:00