2020-07-14 12:59:59 +00:00
|
|
|
error: calling `repeat(1)` on slice
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/repeat_once.rs:9:13
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let a = [1; 5].repeat(1);
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: consider using `.to_vec()` instead: `[1; 5].to_vec()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::repeat-once` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::repeat_once)]`
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
error: calling `repeat(1)` on slice
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/repeat_once.rs:10:13
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let b = slice.repeat(1);
|
|
|
|
| ^^^^^^^^^^^^^^^ help: consider using `.to_vec()` instead: `slice.to_vec()`
|
|
|
|
|
|
|
|
error: calling `repeat(1)` on str
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/repeat_once.rs:11:13
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let c = "hello".repeat(N);
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: consider using `.to_string()` instead: `"hello".to_string()`
|
|
|
|
|
|
|
|
error: calling `repeat(1)` on str
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/repeat_once.rs:12:13
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let d = "hi".repeat(1);
|
|
|
|
| ^^^^^^^^^^^^^^ help: consider using `.to_string()` instead: `"hi".to_string()`
|
|
|
|
|
|
|
|
error: calling `repeat(1)` on str
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/repeat_once.rs:13:13
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let e = s.repeat(1);
|
|
|
|
| ^^^^^^^^^^^ help: consider using `.to_string()` instead: `s.to_string()`
|
|
|
|
|
|
|
|
error: calling `repeat(1)` on a string literal
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/repeat_once.rs:14:13
|
2020-07-14 12:59:59 +00:00
|
|
|
|
|
|
|
|
LL | let f = string.repeat(1);
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: consider using `.clone()` instead: `string.clone()`
|
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
|
|
|
|