1error: this function's return value is unnecessarily wrapped by `Option`
2  --> $DIR/unnecessary_wraps.rs:8:1
3   |
4LL | / fn func1(a: bool, b: bool) -> Option<i32> {
5LL | |     if a && b {
6LL | |         return Some(42);
7LL | |     }
8...  |
9LL | |     }
10LL | | }
11   | |_^
12   |
13   = note: `-D clippy::unnecessary-wraps` implied by `-D warnings`
14help: remove `Option` from the return type...
15   |
16LL | fn func1(a: bool, b: bool) -> i32 {
17   |                               ~~~
18help: ...and then change returning expressions
19   |
20LL ~         return 42;
21LL |     }
22LL |     if a {
23LL |         Some(-1);
24LL ~         2
25LL |     } else {
26 ...
27
28error: this function's return value is unnecessarily wrapped by `Option`
29  --> $DIR/unnecessary_wraps.rs:21:1
30   |
31LL | / fn func2(a: bool, b: bool) -> Option<i32> {
32LL | |     if a && b {
33LL | |         return Some(10);
34LL | |     }
35LL | |     if a { Some(20) } else { Some(30) }
36LL | | }
37   | |_^
38   |
39help: remove `Option` from the return type...
40   |
41LL | fn func2(a: bool, b: bool) -> i32 {
42   |                               ~~~
43help: ...and then change returning expressions
44   |
45LL ~         return 10;
46LL |     }
47LL ~     if a { 20 } else { 30 }
48   |
49
50error: this function's return value is unnecessarily wrapped by `Option`
51  --> $DIR/unnecessary_wraps.rs:39:1
52   |
53LL | / fn func5() -> Option<i32> {
54LL | |     Some(1)
55LL | | }
56   | |_^
57   |
58help: remove `Option` from the return type...
59   |
60LL | fn func5() -> i32 {
61   |               ~~~
62help: ...and then change returning expressions
63   |
64LL |     1
65   |
66
67error: this function's return value is unnecessarily wrapped by `Result`
68  --> $DIR/unnecessary_wraps.rs:49:1
69   |
70LL | / fn func7() -> Result<i32, ()> {
71LL | |     Ok(1)
72LL | | }
73   | |_^
74   |
75help: remove `Result` from the return type...
76   |
77LL | fn func7() -> i32 {
78   |               ~~~
79help: ...and then change returning expressions
80   |
81LL |     1
82   |
83
84error: this function's return value is unnecessarily wrapped by `Option`
85  --> $DIR/unnecessary_wraps.rs:77:5
86   |
87LL | /     fn func12() -> Option<i32> {
88LL | |         Some(1)
89LL | |     }
90   | |_____^
91   |
92help: remove `Option` from the return type...
93   |
94LL |     fn func12() -> i32 {
95   |                    ~~~
96help: ...and then change returning expressions
97   |
98LL |         1
99   |
100
101error: this function's return value is unnecessary
102  --> $DIR/unnecessary_wraps.rs:104:1
103   |
104LL | / fn issue_6640_1(a: bool, b: bool) -> Option<()> {
105LL | |     if a && b {
106LL | |         return Some(());
107LL | |     }
108...  |
109LL | |     }
110LL | | }
111   | |_^
112   |
113help: remove the return type...
114   |
115LL | fn issue_6640_1(a: bool, b: bool) -> Option<()> {
116   |                                      ~~~~~~~~~~
117help: ...and then remove returned values
118   |
119LL ~         return ;
120LL |     }
121LL |     if a {
122LL |         Some(());
123LL ~
124LL |     } else {
125 ...
126
127error: this function's return value is unnecessary
128  --> $DIR/unnecessary_wraps.rs:117:1
129   |
130LL | / fn issue_6640_2(a: bool, b: bool) -> Result<(), i32> {
131LL | |     if a && b {
132LL | |         return Ok(());
133LL | |     }
134...  |
135LL | |     }
136LL | | }
137   | |_^
138   |
139help: remove the return type...
140   |
141LL | fn issue_6640_2(a: bool, b: bool) -> Result<(), i32> {
142   |                                      ~~~~~~~~~~~~~~~
143help: ...and then remove returned values
144   |
145LL ~         return ;
146LL |     }
147LL |     if a {
148LL ~
149LL |     } else {
150LL ~         return ;
151   |
152
153error: aborting due to 7 previous errors
154
155