]> git.lizzy.rs Git - rust.git/commitdiff
Use lowercase in error messages
authorEduardo Broto <ebroto@tutanota.com>
Sun, 11 Oct 2020 20:15:56 +0000 (22:15 +0200)
committerEduardo Broto <ebroto@tutanota.com>
Sun, 11 Oct 2020 20:28:55 +0000 (22:28 +0200)
clippy_lints/src/functions.rs
tests/ui/result_unit_error.stderr

index 212a31006370790fd663b4eb2e15c94d04583142..fd45a6da61ca676739dc186d933780445d8bae62 100644 (file)
     /// use std::fmt;
     ///
     /// #[derive(Debug)]
-    /// struct EndOfStream;
+    /// pub 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();
     ///# }
     /// ```
     ///
@@ -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",
             );
         }
     }
index 986d9718acdbff5fe3d77adaf48a1b6fa0919e38..b8230032491b65e1c1af8c44b6286f2f29a17978 100644 (file)
@@ -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