mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-16 17:58:14 +00:00
eb3970285b
In order to switch `clippy::uninlined_format_args` from pedantic to style, all existing tests must not raise a warning. I did not want to change the actual tests, so this is a relatively minor change that: * add `#![allow(clippy::uninlined_format_args)]` where needed * normalizes all allow/deny/warn attributes * all allow attributes are grouped together * sorted alphabetically * the `clippy::*` attributes are listed separate from the other ones. * deny and warn attributes are listed before the allowed ones changelog: none
123 lines
2.4 KiB
Text
123 lines
2.4 KiB
Text
error: needless use of `for_each`
|
|
--> $DIR/needless_for_each_fixable.rs:16:5
|
|
|
|
|
LL | / v.iter().for_each(|elem| {
|
|
LL | | acc += elem;
|
|
LL | | });
|
|
| |_______^
|
|
|
|
|
= note: `-D clippy::needless-for-each` implied by `-D warnings`
|
|
help: try
|
|
|
|
|
LL ~ for elem in v.iter() {
|
|
LL + acc += elem;
|
|
LL + }
|
|
|
|
|
|
|
error: needless use of `for_each`
|
|
--> $DIR/needless_for_each_fixable.rs:19:5
|
|
|
|
|
LL | / v.into_iter().for_each(|elem| {
|
|
LL | | acc += elem;
|
|
LL | | });
|
|
| |_______^
|
|
|
|
|
help: try
|
|
|
|
|
LL ~ for elem in v.into_iter() {
|
|
LL + acc += elem;
|
|
LL + }
|
|
|
|
|
|
|
error: needless use of `for_each`
|
|
--> $DIR/needless_for_each_fixable.rs:23:5
|
|
|
|
|
LL | / [1, 2, 3].iter().for_each(|elem| {
|
|
LL | | acc += elem;
|
|
LL | | });
|
|
| |_______^
|
|
|
|
|
help: try
|
|
|
|
|
LL ~ for elem in [1, 2, 3].iter() {
|
|
LL + acc += elem;
|
|
LL + }
|
|
|
|
|
|
|
error: needless use of `for_each`
|
|
--> $DIR/needless_for_each_fixable.rs:28:5
|
|
|
|
|
LL | / hash_map.iter().for_each(|(k, v)| {
|
|
LL | | acc += k + v;
|
|
LL | | });
|
|
| |_______^
|
|
|
|
|
help: try
|
|
|
|
|
LL ~ for (k, v) in hash_map.iter() {
|
|
LL + acc += k + v;
|
|
LL + }
|
|
|
|
|
|
|
error: needless use of `for_each`
|
|
--> $DIR/needless_for_each_fixable.rs:31:5
|
|
|
|
|
LL | / hash_map.iter_mut().for_each(|(k, v)| {
|
|
LL | | acc += *k + *v;
|
|
LL | | });
|
|
| |_______^
|
|
|
|
|
help: try
|
|
|
|
|
LL ~ for (k, v) in hash_map.iter_mut() {
|
|
LL + acc += *k + *v;
|
|
LL + }
|
|
|
|
|
|
|
error: needless use of `for_each`
|
|
--> $DIR/needless_for_each_fixable.rs:34:5
|
|
|
|
|
LL | / hash_map.keys().for_each(|k| {
|
|
LL | | acc += k;
|
|
LL | | });
|
|
| |_______^
|
|
|
|
|
help: try
|
|
|
|
|
LL ~ for k in hash_map.keys() {
|
|
LL + acc += k;
|
|
LL + }
|
|
|
|
|
|
|
error: needless use of `for_each`
|
|
--> $DIR/needless_for_each_fixable.rs:37:5
|
|
|
|
|
LL | / hash_map.values().for_each(|v| {
|
|
LL | | acc += v;
|
|
LL | | });
|
|
| |_______^
|
|
|
|
|
help: try
|
|
|
|
|
LL ~ for v in hash_map.values() {
|
|
LL + acc += v;
|
|
LL + }
|
|
|
|
|
|
|
error: needless use of `for_each`
|
|
--> $DIR/needless_for_each_fixable.rs:44:5
|
|
|
|
|
LL | / my_vec().iter().for_each(|elem| {
|
|
LL | | acc += elem;
|
|
LL | | });
|
|
| |_______^
|
|
|
|
|
help: try
|
|
|
|
|
LL ~ for elem in my_vec().iter() {
|
|
LL + acc += elem;
|
|
LL + }
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
|
|