Skip to content

Commit 74ae116

Browse files
committed
Use lowercase in error messages
1 parent 6021c23 commit 74ae116

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

clippy_lints/src/functions.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -194,19 +194,19 @@ declare_clippy_lint! {
194194
/// use std::fmt;
195195
///
196196
/// #[derive(Debug)]
197-
/// struct EndOfStream;
197+
/// pub struct EndOfStream;
198198
///
199199
/// impl fmt::Display for EndOfStream {
200-
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
201-
/// write!(f, "End of Stream")
202-
/// }
200+
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
201+
/// write!(f, "End of Stream")
202+
/// }
203203
/// }
204204
///
205205
/// impl std::error::Error for EndOfStream { }
206206
///
207207
/// pub fn read_u8() -> Result<u8, EndOfStream> { Err(EndOfStream) }
208208
///# fn main() {
209-
///# read_u8().unwrap();
209+
///# read_u8().unwrap();
210210
///# }
211211
/// ```
212212
///
@@ -483,9 +483,9 @@ fn check_result_unit_err(cx: &LateContext<'_>, decl: &hir::FnDecl<'_>, item_span
483483
cx,
484484
RESULT_UNIT_ERR,
485485
fn_header_span,
486-
"This returns a `Result<_, ()>",
486+
"this returns a `Result<_, ()>",
487487
None,
488-
"Use a custom Error type instead",
488+
"use a custom Error type instead",
489489
);
490490
}
491491
}

tests/ui/result_unit_error.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
error: This returns a `Result<_, ()>
1+
error: this returns a `Result<_, ()>
22
--> $DIR/result_unit_error.rs:4:1
33
|
44
LL | pub fn returns_unit_error() -> Result<u32, ()> {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::result-unit-err` implied by `-D warnings`
8-
= help: Use a custom Error type instead
8+
= help: use a custom Error type instead
99

10-
error: This returns a `Result<_, ()>
10+
error: this returns a `Result<_, ()>
1111
--> $DIR/result_unit_error.rs:13:5
1212
|
1313
LL | fn get_that_error(&self) -> Result<bool, ()>;
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1515
|
16-
= help: Use a custom Error type instead
16+
= help: use a custom Error type instead
1717

18-
error: This returns a `Result<_, ()>
18+
error: this returns a `Result<_, ()>
1919
--> $DIR/result_unit_error.rs:15:5
2020
|
2121
LL | fn get_this_one_too(&self) -> Result<bool, ()> {
2222
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2323
|
24-
= help: Use a custom Error type instead
24+
= help: use a custom Error type instead
2525

26-
error: This returns a `Result<_, ()>
26+
error: this returns a `Result<_, ()>
2727
--> $DIR/result_unit_error.rs:33:5
2828
|
2929
LL | pub fn unit_error(&self) -> Result<usize, ()> {
3030
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3131
|
32-
= help: Use a custom Error type instead
32+
= help: use a custom Error type instead
3333

3434
error: aborting due to 4 previous errors
3535

0 commit comments

Comments
 (0)