Skip to content

Commit 7ac744e

Browse files
committed
tests: add underscore
Signed-off-by: Benno Lossin <[email protected]>
1 parent e077745 commit 7ac744e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/underscore.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
use pin_init::{try_init, Init};
2+
3+
pub struct Foo {
4+
x: u64,
5+
}
6+
7+
fn foo() -> bool {
8+
false
9+
}
10+
11+
fn bar() -> bool {
12+
true
13+
}
14+
15+
impl Foo {
16+
pub fn new() -> impl Init<Self, ()> {
17+
try_init!(Self {
18+
_: {
19+
if foo() {
20+
return Err(());
21+
}
22+
},
23+
x: 0,
24+
_: {
25+
if bar() {
26+
return Err(());
27+
}
28+
}
29+
}? ())
30+
}
31+
}

0 commit comments

Comments
 (0)