diff options
| author | Philipp Krones <hello@philkrones.com> | 2022-11-21 20:34:47 +0100 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2022-11-21 20:51:52 +0100 |
| commit | 46c5a5d234f13dcf4bb4cf4241b2addedbf0be14 (patch) | |
| tree | 56726625e55224ecb09ed11f509a964507b9c333 /src/docs/single_element_loop.txt | |
| parent | 3597ed5a099488aa77caf444106a0550b7e5d2e8 (diff) | |
| download | rust-46c5a5d234f13dcf4bb4cf4241b2addedbf0be14.tar.gz rust-46c5a5d234f13dcf4bb4cf4241b2addedbf0be14.zip | |
Merge commit 'f4850f7292efa33759b4f7f9b7621268979e9914' into clippyup
Diffstat (limited to 'src/docs/single_element_loop.txt')
| -rw-r--r-- | src/docs/single_element_loop.txt | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/docs/single_element_loop.txt b/src/docs/single_element_loop.txt deleted file mode 100644 index 6f0c15a85f7..00000000000 --- a/src/docs/single_element_loop.txt +++ /dev/null @@ -1,21 +0,0 @@ -### What it does -Checks whether a for loop has a single element. - -### Why is this bad? -There is no reason to have a loop of a -single element. - -### Example -``` -let item1 = 2; -for item in &[item1] { - println!("{}", item); -} -``` - -Use instead: -``` -let item1 = 2; -let item = &item1; -println!("{}", item); -``` \ No newline at end of file |
