len_without_is_empty fails on Surf #6958
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Lint name:
I tried this code:
https://github.com/http-rs/surf/blob/fb228d8536b041f26f53f7b6eaa3ff56238d9f2c/src/request.rs#L272-L286
I expected to see this happen:
No warning. We implement a
is_empty()
but since the request body is a stream (AsyncRead
), we may not know the length for e.g. chunked request bodies. The natural API for expressing that isOption<>
.Instead, this happened:
https://github.com/http-rs/surf/pull/294/checks?check_run_id=2177417044
Meta
cargo clippy -V
: clippy 0.1.52 (f5d8117 2021-03-16)rustc -Vv
:The text was updated successfully, but these errors were encountered: