Skip to content

Commit 2495aae

Browse files
committed
Fix invalid clippy suggestion
1 parent 2ead471 commit 2495aae

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/tools/clippy/clippy_lints/src/unnecessary_wraps.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWraps {
144144
(
145145
"this function's return value is unnecessary".to_string(),
146146
"remove the return type...".to_string(),
147-
snippet(cx, fn_decl.output.span(), "..").to_string(),
147+
"()".to_string(),
148148
"...and then remove returned values",
149149
)
150150
} else {

src/tools/clippy/tests/ui/unnecessary_wraps.stderr

+4
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ LL | | }
126126
|
127127
help: remove the return type...
128128
|
129+
LL - fn issue_6640_1(a: bool, b: bool) -> Option<()> {
130+
LL + fn issue_6640_1(a: bool, b: bool) -> () {
129131
|
130132
help: ...and then remove returned values
131133
|
@@ -152,6 +154,8 @@ LL | | }
152154
|
153155
help: remove the return type...
154156
|
157+
LL - fn issue_6640_2(a: bool, b: bool) -> Result<(), i32> {
158+
LL + fn issue_6640_2(a: bool, b: bool) -> () {
155159
|
156160
help: ...and then remove returned values
157161
|

0 commit comments

Comments
 (0)