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);
35 LL | | if a { Some(20) } else { Some(30) }
39 help: remove `Option` from the return type...
41 LL | fn func2(a: bool, b: bool) -> i32 {
43 help: ...and then change returning expressions
47 LL | if a { 20 } else { 30 }
50 error: this function's return value is unnecessarily wrapped by `Option`
51 --> $DIR/unnecessary_wraps.rs:39:1
53 LL | / fn func5() -> Option<i32> {
58 help: remove `Option` from the return type...
60 LL | fn func5() -> i32 {
62 help: ...and then change returning expressions
67 error: this function's return value is unnecessarily wrapped by `Result`
68 --> $DIR/unnecessary_wraps.rs:49:1
70 LL | / fn func7() -> Result<i32, ()> {
75 help: remove `Result` from the return type...
77 LL | fn func7() -> i32 {
79 help: ...and then change returning expressions
84 error: this function's return value is unnecessarily wrapped by `Option`
85 --> $DIR/unnecessary_wraps.rs:77:5
87 LL | / fn func12() -> Option<i32> {
92 help: remove `Option` from the return type...
94 LL | fn func12() -> i32 {
96 help: ...and then change returning expressions
101 error: this function's return value is unnecessary
102 --> $DIR/unnecessary_wraps.rs:104:1
104 LL | / fn issue_6640_1(a: bool, b: bool) -> Option<()> {
106 LL | | return Some(());
113 help: remove the return type...
115 LL | fn issue_6640_1(a: bool, b: bool) -> Option<()> {
117 help: ...and then remove returned values
127 error: this function's return value is unnecessary
128 --> $DIR/unnecessary_wraps.rs:117:1
130 LL | / fn issue_6640_2(a: bool, b: bool) -> Result<(), i32> {
132 LL | | return Ok(());
139 help: remove the return type...
141 LL | fn issue_6640_2(a: bool, b: bool) -> Result<(), i32> {
143 help: ...and then remove returned values
153 error: aborting due to 7 previous errors