Skip to content

Commit

Permalink
Change unit type suggestion to unit value
Browse files Browse the repository at this point in the history
  • Loading branch information
dswij committed Dec 28, 2021
1 parent 889bcce commit 020998a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/returns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ fn emit_return_lint(cx: &LateContext<'_>, ret_span: Span, inner_span: Option<Spa
NEEDLESS_RETURN,
ret_span,
"unneeded `return` statement",
"replace `return` with a unit type",
"replace `return` with a unit value",
"()".to_string(),
Applicability::MachineApplicable,
);
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/needless_return.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ error: unneeded `return` statement
--> $DIR/needless_return.rs:74:14
|
LL | _ => return,
| ^^^^^^ help: replace `return` with a unit type: `()`
| ^^^^^^ help: replace `return` with a unit value: `()`

error: unneeded `return` statement
--> $DIR/needless_return.rs:83:13
Expand All @@ -82,7 +82,7 @@ error: unneeded `return` statement
--> $DIR/needless_return.rs:85:14
|
LL | _ => return,
| ^^^^^^ help: replace `return` with a unit type: `()`
| ^^^^^^ help: replace `return` with a unit value: `()`

error: unneeded `return` statement
--> $DIR/needless_return.rs:100:9
Expand Down Expand Up @@ -190,7 +190,7 @@ error: unneeded `return` statement
--> $DIR/needless_return.rs:196:14
|
LL | _ => return,
| ^^^^^^ help: replace `return` with a unit type: `()`
| ^^^^^^ help: replace `return` with a unit value: `()`

error: unneeded `return` statement
--> $DIR/needless_return.rs:211:9
Expand Down

0 comments on commit 020998a

Please sign in to comment.