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
28 error: this function's return value is unnecessarily wrapped by `Option`
29 --> $DIR/unnecessary_wraps.rs:21:1
31 LL | / fn func2(a: bool, b: bool) -> Option<i32> {
33 LL | | return Some(10);
40 help: remove `Option` from the return type...
42 LL | fn func2(a: bool, b: bool) -> i32 {
44 help: ...and then change returning expressions
54 error: this function's return value is unnecessarily wrapped by `Option`
55 --> $DIR/unnecessary_wraps.rs:51:1
57 LL | / fn func5() -> Option<i32> {
62 help: remove `Option` from the return type...
64 LL | fn func5() -> i32 {
66 help: ...and then change returning expressions
71 error: this function's return value is unnecessarily wrapped by `Result`
72 --> $DIR/unnecessary_wraps.rs:61:1
74 LL | / fn func7() -> Result<i32, ()> {
79 help: remove `Result` from the return type...
81 LL | fn func7() -> i32 {
83 help: ...and then change returning expressions
88 error: this function's return value is unnecessarily wrapped by `Option`
89 --> $DIR/unnecessary_wraps.rs:93:5
91 LL | / fn func12() -> Option<i32> {
96 help: remove `Option` from the return type...
98 LL | fn func12() -> i32 {
100 help: ...and then change returning expressions
105 error: this function's return value is unnecessary
106 --> $DIR/unnecessary_wraps.rs:120:1
108 LL | / fn issue_6640_1(a: bool, b: bool) -> Option<()> {
110 LL | | return Some(());
117 help: remove the return type...
119 LL | fn issue_6640_1(a: bool, b: bool) -> Option<()> {
121 help: ...and then remove returned values
131 error: this function's return value is unnecessary
132 --> $DIR/unnecessary_wraps.rs:133:1
134 LL | / fn issue_6640_2(a: bool, b: bool) -> Result<(), i32> {
136 LL | | return Ok(());
143 help: remove the return type...
145 LL | fn issue_6640_2(a: bool, b: bool) -> Result<(), i32> {
147 help: ...and then remove returned values
157 error: aborting due to 7 previous errors