mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-05 22:48:02 +00:00
![]() Fix an invalid suggestion in `needless_collect` test A test, https://github.com/rust-lang/rust-clippy/blob/master/tests/ui/needless_collect_indirect.rs#L11-L12, suggests following codes, but the suggested codes don't work. An example is here: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6947d9f2806a83f41cc5eb8e39b09d0b. ``` error: avoid using `collect()` when not needed --> $DIR/needless_collect_indirect.rs:11:5 | LL | / let indirect_contains = sample.iter().collect::<VecDeque<_>>(); LL | | indirect_contains.contains(&&5); | |____^ | help: Check if the original Iterator contains an element instead of collecting then checking | LL | LL | sample.iter().any(|x| x == &&5); ``` changelog: none |
||
---|---|---|
.. | ||
auxiliary | ||
cargo | ||
ui | ||
ui-cargo | ||
ui-toml | ||
compile-test.rs | ||
dogfood.rs | ||
fmt.rs | ||
integration.rs | ||
missing-test-files.rs | ||
versioncheck.rs |