]> git.lizzy.rs Git - rust.git/blob - tests/ui/unnecessary_wraps.stderr
Auto merge of #79329 - camelid:int-lit-suffix-error, r=davidtwco
[rust.git] / tests / ui / unnecessary_wraps.stderr
1 error: this function's return value is unnecessarily wrapped by `Option`
2   --> $DIR/unnecessary_wraps.rs:8:1
3    |
4 LL | / fn func1(a: bool, b: bool) -> Option<i32> {
5 LL | |     if a && b {
6 LL | |         return Some(42);
7 LL | |     }
8 ...  |
9 LL | |     }
10 LL | | }
11    | |_^
12    |
13    = note: `-D clippy::unnecessary-wraps` implied by `-D warnings`
14 help: remove `Option` from the return type...
15    |
16 LL | fn func1(a: bool, b: bool) -> i32 {
17    |                               ^^^
18 help: ...and change the returning expressions
19    |
20 LL |         return 42;
21 LL |     }
22 LL |     if a {
23 LL |         Some(-1);
24 LL |         2
25 LL |     } else {
26  ...
27
28 error: this function's return value is unnecessarily wrapped by `Option`
29   --> $DIR/unnecessary_wraps.rs:21:1
30    |
31 LL | / fn func2(a: bool, b: bool) -> Option<i32> {
32 LL | |     if a && b {
33 LL | |         return Some(10);
34 LL | |     }
35 ...  |
36 LL | |     }
37 LL | | }
38    | |_^
39    |
40 help: remove `Option` from the return type...
41    |
42 LL | fn func2(a: bool, b: bool) -> i32 {
43    |                               ^^^
44 help: ...and change the returning expressions
45    |
46 LL |         return 10;
47 LL |     }
48 LL |     if a {
49 LL |         20
50 LL |     } else {
51 LL |         30
52    |
53
54 error: this function's return value is unnecessarily wrapped by `Option`
55   --> $DIR/unnecessary_wraps.rs:51:1
56    |
57 LL | / fn func5() -> Option<i32> {
58 LL | |     Some(1)
59 LL | | }
60    | |_^
61    |
62 help: remove `Option` from the return type...
63    |
64 LL | fn func5() -> i32 {
65    |               ^^^
66 help: ...and change the returning expressions
67    |
68 LL |     1
69    |
70
71 error: this function's return value is unnecessarily wrapped by `Result`
72   --> $DIR/unnecessary_wraps.rs:61:1
73    |
74 LL | / fn func7() -> Result<i32, ()> {
75 LL | |     Ok(1)
76 LL | | }
77    | |_^
78    |
79 help: remove `Result` from the return type...
80    |
81 LL | fn func7() -> i32 {
82    |               ^^^
83 help: ...and change the returning expressions
84    |
85 LL |     1
86    |
87
88 error: this function's return value is unnecessarily wrapped by `Option`
89   --> $DIR/unnecessary_wraps.rs:93:5
90    |
91 LL | /     fn func12() -> Option<i32> {
92 LL | |         Some(1)
93 LL | |     }
94    | |_____^
95    |
96 help: remove `Option` from the return type...
97    |
98 LL |     fn func12() -> i32 {
99    |                    ^^^
100 help: ...and change the returning expressions
101    |
102 LL |         1
103    |
104
105 error: aborting due to 5 previous errors
106