Skip to content

Commit 2226b0e

Browse files
committed
Revise diagnostic message
1 parent 671f4c9 commit 2226b0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/default_box_assignments.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
);

0 commit comments

Comments
 (0)