Skip to content

Commit c0e168f

Browse files
committed
update help text
1 parent 0a537b0 commit c0e168f

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

clippy_lints/src/new_without_default.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,9 @@ fn suggest_default_mismatch_new<'tcx>(
382382
format!("`new()` may produce different values than the auto-derived `Default` for `{self_type_snip}`"),
383383
|diag| {
384384
diag.help(
385-
"When a type derives `Default`, users expect `new()` and `default()` to be equivalent. \
385+
"when a type derives `Default`, users expect `new()` and `default()` to be equivalent. \
386386
Consider delegating to `Self::default()` for consistency, or rename `new` if the \
387-
behavior is intentionally different.",
387+
behavior is intentionally different",
388388
);
389389
diag.span_suggestion(span, "use", "Self::default()", Applicability::MaybeIncorrect);
390390
},

tests/ui/default_mismatches_new.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | || Self { value: 0 }
99
LL | | }
1010
| |______^
1111
|
12-
= help: When a type derives `Default`, users expect `new()` and `default()` to be equivalent. Consider delegating to `Self::default()` for consistency, or rename `new` if the behavior is intentionally different.
12+
= help: when a type derives `Default`, users expect `new()` and `default()` to be equivalent. Consider delegating to `Self::default()` for consistency, or rename `new` if the behavior is intentionally different
1313
= note: `-D clippy::default-mismatches-new` implied by `-D warnings`
1414
= help: to override `-D warnings` add `#[allow(clippy::default_mismatches_new)]`
1515

@@ -24,7 +24,7 @@ LL | || Self(0)
2424
LL | | }
2525
| |______^
2626
|
27-
= help: When a type derives `Default`, users expect `new()` and `default()` to be equivalent. Consider delegating to `Self::default()` for consistency, or rename `new` if the behavior is intentionally different.
27+
= help: when a type derives `Default`, users expect `new()` and `default()` to be equivalent. Consider delegating to `Self::default()` for consistency, or rename `new` if the behavior is intentionally different
2828

2929
error: `new()` may produce different values than the auto-derived `Default` for `NonZeroDeriveDefault`
3030
--> tests/ui/default_mismatches_new.rs:130:22
@@ -37,7 +37,7 @@ LL | || Self(42)
3737
LL | | }
3838
| |______^
3939
|
40-
= help: When a type derives `Default`, users expect `new()` and `default()` to be equivalent. Consider delegating to `Self::default()` for consistency, or rename `new` if the behavior is intentionally different.
40+
= help: when a type derives `Default`, users expect `new()` and `default()` to be equivalent. Consider delegating to `Self::default()` for consistency, or rename `new` if the behavior is intentionally different
4141

4242
error: `new()` may produce different values than the auto-derived `Default` for `ExtraBlockDefault`
4343
--> tests/ui/default_mismatches_new.rs:139:22
@@ -50,7 +50,7 @@ LL | || { Self::default() }
5050
LL | | }
5151
| |______^
5252
|
53-
= help: When a type derives `Default`, users expect `new()` and `default()` to be equivalent. Consider delegating to `Self::default()` for consistency, or rename `new` if the behavior is intentionally different.
53+
= help: when a type derives `Default`, users expect `new()` and `default()` to be equivalent. Consider delegating to `Self::default()` for consistency, or rename `new` if the behavior is intentionally different
5454

5555
error: `new()` may produce different values than the auto-derived `Default` for `ExtraBlockRetDefault`
5656
--> tests/ui/default_mismatches_new.rs:148:22
@@ -65,7 +65,7 @@ LL | || };
6565
LL | | }
6666
| |______^
6767
|
68-
= help: When a type derives `Default`, users expect `new()` and `default()` to be equivalent. Consider delegating to `Self::default()` for consistency, or rename `new` if the behavior is intentionally different.
68+
= help: when a type derives `Default`, users expect `new()` and `default()` to be equivalent. Consider delegating to `Self::default()` for consistency, or rename `new` if the behavior is intentionally different
6969

7070
error: `new()` may produce different values than the auto-derived `Default` for `MultiStatements`
7171
--> tests/ui/default_mismatches_new.rs:163:22
@@ -80,7 +80,7 @@ LL | || Self(i)
8080
LL | | }
8181
| |______^
8282
|
83-
= help: When a type derives `Default`, users expect `new()` and `default()` to be equivalent. Consider delegating to `Self::default()` for consistency, or rename `new` if the behavior is intentionally different.
83+
= help: when a type derives `Default`, users expect `new()` and `default()` to be equivalent. Consider delegating to `Self::default()` for consistency, or rename `new` if the behavior is intentionally different
8484

8585
error: aborting due to 6 previous errors
8686

0 commit comments

Comments
 (0)