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 {
5151 cx,
5252 DEFAULT_BOX_ASSIGNMENTS ,
5353 expr. span ,
54- "assigning `Default::default()` to `Box<T>` " ,
54+ "creating a new box with default content " ,
5555 |diag| {
5656 let mut app = Applicability :: MachineApplicable ;
5757 let suggestion = format ! (
@@ -61,7 +61,7 @@ impl LateLintPass<'_> for DefaultBoxAssignments {
6161
6262 diag. note ( "this creates a needless allocation" ) . span_suggestion (
6363 expr. span ,
64- "assign to the inner value " ,
64+ "replace existing content with default instead " ,
6565 suggestion,
6666 app,
6767 ) ;
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
22 --> tests/ui/default_box_assignments.rs:11:5
33 |
44LL | b = Default::default();
5- | ^^^^^^^^^^^^^^^^^^^^^^ help: assign to the inner value : `*b = Default::default()`
5+ | ^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with default instead : `*b = Default::default()`
66 |
77 = note: this creates a needless allocation
88 = note: `-D clippy::default-box-assignments` implied by `-D warnings`
99 = help: to override `-D warnings` add `#[allow(clippy::default_box_assignments)]`
1010
11- error: assigning `Default::default()` to `Box<T>`
11+ error: creating a new box with default content
1212 --> tests/ui/default_box_assignments.rs:13:5
1313 |
1414LL | b = Box::default();
15- | ^^^^^^^^^^^^^^^^^^ help: assign to the inner value : `*b = Default::default()`
15+ | ^^^^^^^^^^^^^^^^^^ help: replace existing content with default instead : `*b = Default::default()`
1616 |
1717 = note: this creates a needless allocation
1818
You can’t perform that action at this time.
0 commit comments