Skip to content

Commit 2de290d

Browse files
committed
duration-subsec: make lint adhere to lint message convention
1 parent 4236156 commit 2de290d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clippy_lints/src/duration_subsec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<'tcx> LateLintPass<'tcx> for DurationSubsec {
5656
cx,
5757
DURATION_SUBSEC,
5858
expr.span,
59-
&format!("Calling `{}()` is more concise than this calculation", suggested_fn),
59+
&format!("calling `{}()` is more concise than this calculation", suggested_fn),
6060
"try",
6161
format!(
6262
"{}.{}()",

tests/ui/duration_subsec.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
error: Calling `subsec_millis()` is more concise than this calculation
1+
error: calling `subsec_millis()` is more concise than this calculation
22
--> $DIR/duration_subsec.rs:10:24
33
|
44
LL | let bad_millis_1 = dur.subsec_micros() / 1_000;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_millis()`
66
|
77
= note: `-D clippy::duration-subsec` implied by `-D warnings`
88

9-
error: Calling `subsec_millis()` is more concise than this calculation
9+
error: calling `subsec_millis()` is more concise than this calculation
1010
--> $DIR/duration_subsec.rs:11:24
1111
|
1212
LL | let bad_millis_2 = dur.subsec_nanos() / 1_000_000;
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_millis()`
1414

15-
error: Calling `subsec_micros()` is more concise than this calculation
15+
error: calling `subsec_micros()` is more concise than this calculation
1616
--> $DIR/duration_subsec.rs:16:22
1717
|
1818
LL | let bad_micros = dur.subsec_nanos() / 1_000;
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_micros()`
2020

21-
error: Calling `subsec_micros()` is more concise than this calculation
21+
error: calling `subsec_micros()` is more concise than this calculation
2222
--> $DIR/duration_subsec.rs:21:13
2323
|
2424
LL | let _ = (&dur).subsec_nanos() / 1_000;
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&dur).subsec_micros()`
2626

27-
error: Calling `subsec_micros()` is more concise than this calculation
27+
error: calling `subsec_micros()` is more concise than this calculation
2828
--> $DIR/duration_subsec.rs:25:13
2929
|
3030
LL | let _ = dur.subsec_nanos() / NANOS_IN_MICRO;

0 commit comments

Comments
 (0)