File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 5
5
clippy::redundant_clone,
6
6
clippy::deref_addrof,
7
7
clippy::no_effect,
8
- clippy::unnecessary_operation
8
+ clippy::unnecessary_operation,
9
+ clippy::vec_init_then_push
9
10
)]
10
11
11
12
use std::cell::RefCell;
Original file line number Diff line number Diff line change 5
5
clippy:: redundant_clone,
6
6
clippy:: deref_addrof,
7
7
clippy:: no_effect,
8
- clippy:: unnecessary_operation
8
+ clippy:: unnecessary_operation,
9
+ clippy:: vec_init_then_push
9
10
) ]
10
11
11
12
use std:: cell:: RefCell ;
Original file line number Diff line number Diff line change 1
1
error: using `clone` on type `i32` which implements the `Copy` trait
2
- --> $DIR/clone_on_copy.rs:22 :5
2
+ --> $DIR/clone_on_copy.rs:23 :5
3
3
|
4
4
LL | 42.clone();
5
5
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
6
6
|
7
7
= note: `-D clippy::clone-on-copy` implied by `-D warnings`
8
8
9
9
error: using `clone` on type `i32` which implements the `Copy` trait
10
- --> $DIR/clone_on_copy.rs:26 :5
10
+ --> $DIR/clone_on_copy.rs:27 :5
11
11
|
12
12
LL | (&42).clone();
13
13
| ^^^^^^^^^^^^^ help: try dereferencing it: `*(&42)`
14
14
15
15
error: using `clone` on type `i32` which implements the `Copy` trait
16
- --> $DIR/clone_on_copy.rs:29 :5
16
+ --> $DIR/clone_on_copy.rs:30 :5
17
17
|
18
18
LL | rc.borrow().clone();
19
19
| ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*rc.borrow()`
20
20
21
21
error: using `clone` on type `char` which implements the `Copy` trait
22
- --> $DIR/clone_on_copy.rs:35 :14
22
+ --> $DIR/clone_on_copy.rs:36 :14
23
23
|
24
24
LL | is_ascii('z'.clone());
25
25
| ^^^^^^^^^^^ help: try removing the `clone` call: `'z'`
26
26
27
27
error: using `clone` on type `i32` which implements the `Copy` trait
28
- --> $DIR/clone_on_copy.rs:39 :14
28
+ --> $DIR/clone_on_copy.rs:40 :14
29
29
|
30
30
LL | vec.push(42.clone());
31
31
| ^^^^^^^^^^ help: try removing the `clone` call: `42`
You can’t perform that action at this time.
0 commit comments