Skip to content

Commit

Permalink
doc: let-else is now stable
Browse files Browse the repository at this point in the history
The `let else` feature was stabilized by [rust-lang/rust#93628][1] in
Rust 1.65.0.

[1]: rust-lang/rust#93628
  • Loading branch information
yvt committed May 3, 2023
1 parent 8fb7853 commit 278407a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ assert!(enums[1].is_var2());
fn this_fn_expects_var1(foo: &Enum<[u8; 4]>) {
let (i0, i1) = try_match!(foo, &Var1([_0, _, _, _1])).unwrap();

// Once RFC 1303 is stabilized, you can do instead:
// let &Var1([i0, _, _, i1]) = foo else { panic!("{:?}", foo) };
// Alternatively, you could use let-else (stabilized in Rust 1.65.0):
// let &Var1([i0, _, _, i1]) = foo else { panic!("{foo:?}") };

assert_eq!((i0, i1), (42, 45));
}
Expand Down

0 comments on commit 278407a

Please sign in to comment.