Skip to content

Commit

Permalink
Use lowercase in error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ebroto committed Oct 11, 2020
1 parent 6021c23 commit 2703e7a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions clippy_lints/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,16 @@ declare_clippy_lint! {
/// struct EndOfStream;
///
/// impl fmt::Display for EndOfStream {
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
/// write!(f, "End of Stream")
/// }
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
/// write!(f, "End of Stream")
/// }
/// }
///
/// impl std::error::Error for EndOfStream { }
///
/// pub fn read_u8() -> Result<u8, EndOfStream> { Err(EndOfStream) }
///# fn main() {
///# read_u8().unwrap();
///# read_u8().unwrap();
///# }
/// ```
///
Expand Down Expand Up @@ -483,9 +483,9 @@ fn check_result_unit_err(cx: &LateContext<'_>, decl: &hir::FnDecl<'_>, item_span
cx,
RESULT_UNIT_ERR,
fn_header_span,
"This returns a `Result<_, ()>",
"this returns a `Result<_, ()>",
None,
"Use a custom Error type instead",
"use a custom Error type instead",
);
}
}
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/result_unit_error.stderr
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
error: This returns a `Result<_, ()>
error: this returns a `Result<_, ()>
--> $DIR/result_unit_error.rs:4:1
|
LL | pub fn returns_unit_error() -> Result<u32, ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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
|
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
|
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
|
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

0 comments on commit 2703e7a

Please sign in to comment.