1 error: this function's return value is unnecessarily wrapped by `Option`
2 --> $DIR/unnecessary_wraps.rs:8:1
4 LL | / fn func1(a: bool, b: bool) -> Option<i32> {
6 LL | | return Some(42);
13 = note: `-D clippy::unnecessary-wraps` implied by `-D warnings`
14 help: remove `Option` from the return type...
16 LL | fn func1(a: bool, b: bool) -> i32 {
18 help: ...and then change returning expressions
29 error: this function's return value is unnecessarily wrapped by `Option`
30 --> $DIR/unnecessary_wraps.rs:21:1
32 LL | / fn func2(a: bool, b: bool) -> Option<i32> {
34 LL | | return Some(10);
36 LL | | if a { Some(20) } else { Some(30) }
40 help: remove `Option` from the return type...
42 LL | fn func2(a: bool, b: bool) -> i32 {
44 help: ...and then change returning expressions
48 LL ~ if a { 20 } else { 30 }
51 error: this function's return value is unnecessarily wrapped by `Option`
52 --> $DIR/unnecessary_wraps.rs:39:1
54 LL | / fn func5() -> Option<i32> {
59 help: remove `Option` from the return type...
61 LL | fn func5() -> i32 {
63 help: ...and then change returning expressions
68 error: this function's return value is unnecessarily wrapped by `Result`
69 --> $DIR/unnecessary_wraps.rs:49:1
71 LL | / fn func7() -> Result<i32, ()> {
76 help: remove `Result` from the return type...
78 LL | fn func7() -> i32 {
80 help: ...and then change returning expressions
85 error: this function's return value is unnecessarily wrapped by `Option`
86 --> $DIR/unnecessary_wraps.rs:77:5
88 LL | / fn func12() -> Option<i32> {
93 help: remove `Option` from the return type...
95 LL | fn func12() -> i32 {
97 help: ...and then change returning expressions
102 error: this function's return value is unnecessary
103 --> $DIR/unnecessary_wraps.rs:104:1
105 LL | / fn issue_6640_1(a: bool, b: bool) -> Option<()> {
107 LL | | return Some(());
114 help: remove the return type...
116 LL | fn issue_6640_1(a: bool, b: bool) -> Option<()> {
118 help: ...and then remove returned values
129 error: this function's return value is unnecessary
130 --> $DIR/unnecessary_wraps.rs:117:1
132 LL | / fn issue_6640_2(a: bool, b: bool) -> Result<(), i32> {
134 LL | | return Ok(());
141 help: remove the return type...
143 LL | fn issue_6640_2(a: bool, b: bool) -> Result<(), i32> {
145 help: ...and then remove returned values
155 error: aborting due to 7 previous errors