From 278407a188280216491edc34621e352019bca544 Mon Sep 17 00:00:00 2001 From: yvt Date: Wed, 3 May 2023 16:03:38 +0900 Subject: [PATCH] doc: let-else is now stable The `let else` feature was stabilized by [rust-lang/rust#93628][1] in Rust 1.65.0. [1]: https://github.com/rust-lang/rust/pull/93628/ --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9dcd9da..39f3f55 100644 --- a/README.md +++ b/README.md @@ -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)); }