fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.4 KiB41 linesraw
1error: calling `repeat(1)` on slice
2  --> $DIR/repeat_once.rs:9:13
3   |
4LL |     let a = [1; 5].repeat(1);
5   |             ^^^^^^^^^^^^^^^^ help: consider using `.to_vec()` instead: `[1; 5].to_vec()`
6   |
7   = note: `-D clippy::repeat-once` implied by `-D warnings`
8   = help: to override `-D warnings` add `#[allow(clippy::repeat_once)]`
9
10error: calling `repeat(1)` on slice
11  --> $DIR/repeat_once.rs:10:13
12   |
13LL |     let b = slice.repeat(1);
14   |             ^^^^^^^^^^^^^^^ help: consider using `.to_vec()` instead: `slice.to_vec()`
15
16error: calling `repeat(1)` on str
17  --> $DIR/repeat_once.rs:11:13
18   |
19LL |     let c = "hello".repeat(N);
20   |             ^^^^^^^^^^^^^^^^^ help: consider using `.to_string()` instead: `"hello".to_string()`
21
22error: calling `repeat(1)` on str
23  --> $DIR/repeat_once.rs:12:13
24   |
25LL |     let d = "hi".repeat(1);
26   |             ^^^^^^^^^^^^^^ help: consider using `.to_string()` instead: `"hi".to_string()`
27
28error: calling `repeat(1)` on str
29  --> $DIR/repeat_once.rs:13:13
30   |
31LL |     let e = s.repeat(1);
32   |             ^^^^^^^^^^^ help: consider using `.to_string()` instead: `s.to_string()`
33
34error: calling `repeat(1)` on a string literal
35  --> $DIR/repeat_once.rs:14:13
36   |
37LL |     let f = string.repeat(1);
38   |             ^^^^^^^^^^^^^^^^ help: consider using `.clone()` instead: `string.clone()`
39
40error: aborting due to 6 previous errors
41