File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ impl LateLintPass<'_> for DefaultBoxAssignments {
51
51
cx,
52
52
DEFAULT_BOX_ASSIGNMENTS ,
53
53
expr. span ,
54
- "assigning `Default::default()` to `Box<T>` " ,
54
+ "creating a new box with default content " ,
55
55
|diag| {
56
56
let mut app = Applicability :: MachineApplicable ;
57
57
let suggestion = format ! (
@@ -61,7 +61,7 @@ impl LateLintPass<'_> for DefaultBoxAssignments {
61
61
62
62
diag. note ( "this creates a needless allocation" ) . span_suggestion (
63
63
expr. span ,
64
- "assign to the inner value " ,
64
+ "replace existing content with default instead " ,
65
65
suggestion,
66
66
app,
67
67
) ;
Original file line number Diff line number Diff line change 1
- error: assigning `Default::default()` to `Box<T>`
1
+ error: creating a new box with default content
2
2
--> tests/ui/default_box_assignments.rs:11:5
3
3
|
4
4
LL | b = Default::default();
5
- | ^^^^^^^^^^^^^^^^^^^^^^ help: assign to the inner value : `*b = Default::default()`
5
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with default instead : `*b = Default::default()`
6
6
|
7
7
= note: this creates a needless allocation
8
8
= note: `-D clippy::default-box-assignments` implied by `-D warnings`
9
9
= help: to override `-D warnings` add `#[allow(clippy::default_box_assignments)]`
10
10
11
- error: assigning `Default::default()` to `Box<T>`
11
+ error: creating a new box with default content
12
12
--> tests/ui/default_box_assignments.rs:13:5
13
13
|
14
14
LL | b = Box::default();
15
- | ^^^^^^^^^^^^^^^^^^ help: assign to the inner value : `*b = Default::default()`
15
+ | ^^^^^^^^^^^^^^^^^^ help: replace existing content with default instead : `*b = Default::default()`
16
16
|
17
17
= note: this creates a needless allocation
18
18
You can’t perform that action at this time.
0 commit comments