diff options
Diffstat (limited to 'src/tools/clippy/src/docs/explicit_into_iter_loop.txt')
-rw-r--r-- | src/tools/clippy/src/docs/explicit_into_iter_loop.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/explicit_into_iter_loop.txt b/src/tools/clippy/src/docs/explicit_into_iter_loop.txt new file mode 100644 index 000000000..3931dfd69 --- /dev/null +++ b/src/tools/clippy/src/docs/explicit_into_iter_loop.txt @@ -0,0 +1,20 @@ +### What it does +Checks for loops on `y.into_iter()` where `y` will do, and +suggests the latter. + +### Why is this bad? +Readability. + +### Example +``` +// with `y` a `Vec` or slice: +for x in y.into_iter() { + // .. +} +``` +can be rewritten to +``` +for x in y { + // .. +} +```
\ No newline at end of file |