.read().ok()
does not trigger unused_io_amount
warning
#7096
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-negative
Issue: The lint should have been triggered on code, but wasn't
Lint name: unused_io_amount
I tried this code:
I expected to see this happen: explanation
If you use
reader.read(&mut result).unwrap()
, clippy correctly triggers error "read amount is not handled. UseRead::read_exact
instead"Instead, this happened: explanation
Appending
.ok()?
consumes the error, but clippy does not report theunused_io_amount
warning any more.Meta
cargo clippy -V
: clippy 0.1.51 (2fd73fa 2021-03-23)rustc -Vv
:The text was updated successfully, but these errors were encountered: