This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ pub(super) fn check<'tcx>(
9595 cx,
9696 SINGLE_ELEMENT_LOOP ,
9797 arg. span ,
98- format ! ( "this loops only once with {pat_snip} being {range_expr}" ) . as_str ( ) ,
98+ format ! ( "this loops only once with ` {pat_snip}` being ` {range_expr}` " ) . as_str ( ) ,
9999 "did you mean to iterate over the range instead?" ,
100100 sugg. to_string ( ) ,
101101 Applicability :: Unspecified ,
Original file line number Diff line number Diff line change @@ -32,25 +32,25 @@ LL + dbg!(item);
3232LL + }
3333 |
3434
35- error: this loops only once with item being 0..5
35+ error: this loops only once with ` item` being ` 0..5`
3636 --> $DIR/single_element_loop.rs:16:17
3737 |
3838LL | for item in &[0..5] {
3939 | ^^^^^^^ help: did you mean to iterate over the range instead?: `0..5`
4040
41- error: this loops only once with item being 0..5
41+ error: this loops only once with ` item` being ` 0..5`
4242 --> $DIR/single_element_loop.rs:20:17
4343 |
4444LL | for item in [0..5].iter_mut() {
4545 | ^^^^^^^^^^^^^^^^^ help: did you mean to iterate over the range instead?: `0..5`
4646
47- error: this loops only once with item being 0..5
47+ error: this loops only once with ` item` being ` 0..5`
4848 --> $DIR/single_element_loop.rs:24:17
4949 |
5050LL | for item in [0..5] {
5151 | ^^^^^^ help: did you mean to iterate over the range instead?: `0..5`
5252
53- error: this loops only once with item being 0..5
53+ error: this loops only once with ` item` being ` 0..5`
5454 --> $DIR/single_element_loop.rs:28:17
5555 |
5656LL | for item in [0..5].into_iter() {
You can’t perform that action at this time.
0 commit comments