Skip to content

result_unit_err: Fix typo #7007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clippy_lints/src/functions/result_unit_err.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,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/len_without_is_empty.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -86,38 +86,38 @@ LL | pub fn is_empty(&self) -> Option<bool> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: expected signature: `(&self) -> bool` or `(&self) -> Result<bool>

error: this returns a `Result<_, ()>
error: this returns a `Result<_, ()>`
--> $DIR/len_without_is_empty.rs:230:5
|
LL | pub fn len(&self) -> Result<usize, ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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/len_without_is_empty.rs:242:5
|
LL | pub fn len(&self) -> Result<usize, ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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/len_without_is_empty.rs:246:5
|
LL | pub fn is_empty(&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/len_without_is_empty.rs:253:5
|
LL | pub fn len(&self) -> Result<usize, ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use a custom Error type instead
= help: use a custom `Error` type instead

error: aborting due to 12 previous errors

20 changes: 10 additions & 10 deletions tests/ui/result_unit_error.stderr
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
error: this returns a `Result<_, ()>
error: this returns a `Result<_, ()>`
--> $DIR/result_unit_error.rs:3: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:12: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:14: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:32:5
|
LL | pub fn unit_error(&self) -> Result<usize, ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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:41:5
|
LL | pub fn should_lint() -> ResInv<(), usize> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use a custom Error type instead
= help: use a custom `Error` type instead

error: aborting due to 5 previous errors