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 {
100
100
cx,
101
101
UNNECESSARY_WRAP ,
102
102
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 ( ) ,
104
104
|diag| {
105
105
let inner_ty = return_ty ( cx, hir_id)
106
106
. 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`
2
2
--> $DIR/unnecessary_wrap.rs:8:1
3
3
|
4
4
LL | / fn func1(a: bool, b: bool) -> Option<i32> {
25
25
LL | } else {
26
26
...
27
27
28
- error: this function returns unnecessarily wrapping data
28
+ error: this function's return value is unnecessarily wrapped by `Option`
29
29
--> $DIR/unnecessary_wrap.rs:21:1
30
30
|
31
31
LL | / fn func2(a: bool, b: bool) -> Option<i32> {
@@ -51,7 +51,7 @@ LL | } else {
51
51
LL | 30
52
52
|
53
53
54
- error: this function returns unnecessarily wrapping data
54
+ error: this function's return value is unnecessarily wrapped by `Option`
55
55
--> $DIR/unnecessary_wrap.rs:51:1
56
56
|
57
57
LL | / fn func5() -> Option<i32> {
@@ -68,7 +68,7 @@ help: ...and change the returning expressions
68
68
LL | 1
69
69
|
70
70
71
- error: this function returns unnecessarily wrapping data
71
+ error: this function's return value is unnecessarily wrapped by `Result`
72
72
--> $DIR/unnecessary_wrap.rs:61:1
73
73
|
74
74
LL | / fn func7() -> Result<i32, ()> {
You can’t perform that action at this time.
0 commit comments