This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
100100 cx,
101101 UNNECESSARY_WRAP ,
102102 span,
103- format ! ( "this function's return value is unnecessarily wrapped by `{}`, return_type)" ,
103+ format ! ( "this function's return value is unnecessarily wrapped by `{}`" , return_type) . as_str ( ) ,
104104 |diag| {
105105 let inner_ty = return_ty ( cx, hir_id)
106106 . walk ( )
Original file line number Diff line number Diff line change 1- error: this function returns unnecessarily wrapping data
1+ error: this function's return value is unnecessarily wrapped by `Option`
22 --> $DIR/unnecessary_wrap.rs:8:1
33 |
44LL | / fn func1(a: bool, b: bool) -> Option<i32> {
2525LL | } else {
2626 ...
2727
28- error: this function returns unnecessarily wrapping data
28+ error: this function's return value is unnecessarily wrapped by `Option`
2929 --> $DIR/unnecessary_wrap.rs:21:1
3030 |
3131LL | / fn func2(a: bool, b: bool) -> Option<i32> {
@@ -51,7 +51,7 @@ LL | } else {
5151LL | 30
5252 |
5353
54- error: this function returns unnecessarily wrapping data
54+ error: this function's return value is unnecessarily wrapped by `Option`
5555 --> $DIR/unnecessary_wrap.rs:51:1
5656 |
5757LL | / fn func5() -> Option<i32> {
@@ -68,7 +68,7 @@ help: ...and change the returning expressions
6868LL | 1
6969 |
7070
71- error: this function returns unnecessarily wrapping data
71+ error: this function's return value is unnecessarily wrapped by `Result`
7272 --> $DIR/unnecessary_wrap.rs:61:1
7373 |
7474LL | / fn func7() -> Result<i32, ()> {
You can’t perform that action at this time.
0 commit comments