4

[`useless_vec`]: lint on `vec![_]` invocations that adjust to a slice by y21 · P...

 1 year ago
source link: https://github.com/rust-lang/rust-clippy/pull/10933
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Contributor

@y21 y21

commented

Jun 12, 2023

edited

Fixes #2262 (well, actually my PR over at #10901 did do most of the stuff, but this PR implements the one last other case mentioned in the comments that my PR didn't fix)

Before this change, it would lint (&vec![1]).iter().sum::<i32>(), but not vec![1].iter().sum::<i32>(). This PR handles this case.
This also refactors a few things that I wanted to do in my other PR but forgot about.

changelog: [useless_vec]: lint on vec![_] invocations that adjust to a slice


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK