Use lowercase in error messages

This commit is contained in:
Eduardo Broto 2020-10-11 22:15:56 +02:00
parent 6021c23159
commit 74ae116131
2 changed files with 15 additions and 15 deletions

View File

@ -194,7 +194,7 @@ declare_clippy_lint! {
/// use std::fmt; /// use std::fmt;
/// ///
/// #[derive(Debug)] /// #[derive(Debug)]
/// struct EndOfStream; /// pub struct EndOfStream;
/// ///
/// impl fmt::Display for EndOfStream { /// impl fmt::Display for EndOfStream {
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { /// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@ -483,9 +483,9 @@ fn check_result_unit_err(cx: &LateContext<'_>, decl: &hir::FnDecl<'_>, item_span
cx, cx,
RESULT_UNIT_ERR, RESULT_UNIT_ERR,
fn_header_span, fn_header_span,
"This returns a `Result<_, ()>", "this returns a `Result<_, ()>",
None, None,
"Use a custom Error type instead", "use a custom Error type instead",
); );
} }
} }

View File

@ -1,35 +1,35 @@
error: This returns a `Result<_, ()> error: this returns a `Result<_, ()>
--> $DIR/result_unit_error.rs:4:1 --> $DIR/result_unit_error.rs:4:1
| |
LL | pub fn returns_unit_error() -> Result<u32, ()> { LL | pub fn returns_unit_error() -> Result<u32, ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: `-D clippy::result-unit-err` implied by `-D warnings` = note: `-D clippy::result-unit-err` implied by `-D warnings`
= help: Use a custom Error type instead = help: use a custom Error type instead
error: This returns a `Result<_, ()> error: this returns a `Result<_, ()>
--> $DIR/result_unit_error.rs:13:5 --> $DIR/result_unit_error.rs:13:5
| |
LL | fn get_that_error(&self) -> Result<bool, ()>; LL | fn get_that_error(&self) -> Result<bool, ()>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= help: Use a custom Error type instead = help: use a custom Error type instead
error: This returns a `Result<_, ()> error: this returns a `Result<_, ()>
--> $DIR/result_unit_error.rs:15:5 --> $DIR/result_unit_error.rs:15:5
| |
LL | fn get_this_one_too(&self) -> Result<bool, ()> { LL | fn get_this_one_too(&self) -> Result<bool, ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= help: Use a custom Error type instead = help: use a custom Error type instead
error: This returns a `Result<_, ()> error: this returns a `Result<_, ()>
--> $DIR/result_unit_error.rs:33:5 --> $DIR/result_unit_error.rs:33:5
| |
LL | pub fn unit_error(&self) -> Result<usize, ()> { LL | pub fn unit_error(&self) -> Result<usize, ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= help: Use a custom Error type instead = help: use a custom Error type instead
error: aborting due to 4 previous errors error: aborting due to 4 previous errors