summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/range_zip_with_len.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/src/docs/range_zip_with_len.txt')
-rw-r--r--src/tools/clippy/src/docs/range_zip_with_len.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/range_zip_with_len.txt b/src/tools/clippy/src/docs/range_zip_with_len.txt
new file mode 100644
index 000000000..24c1efec7
--- /dev/null
+++ b/src/tools/clippy/src/docs/range_zip_with_len.txt
@@ -0,0 +1,16 @@
+### What it does
+Checks for zipping a collection with the range of
+`0.._.len()`.
+
+### Why is this bad?
+The code is better expressed with `.enumerate()`.
+
+### Example
+```
+let _ = x.iter().zip(0..x.len());
+```
+
+Use instead:
+```
+let _ = x.iter().enumerate();
+``` \ No newline at end of file