From e5e33a1159f6aeacbfb3aa0f5a5f0f58f6b7dcca Mon Sep 17 00:00:00 2001 From: Manichand Kondapaka Date: Wed, 20 Mar 2024 02:19:26 +0530 Subject: [PATCH] Removed destructuring about struct (#1924) #1464 issue . Let's limit this section to arrays and tuples. Destructuring in structs explained in [Day-2 Morning]((https://google.github.io/comprehensive-rust/pattern-matching/destructuring.html)). --- src/tuples-and-arrays/destructuring.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/tuples-and-arrays/destructuring.md b/src/tuples-and-arrays/destructuring.md index dfc8dcea..6d5a15b7 100644 --- a/src/tuples-and-arrays/destructuring.md +++ b/src/tuples-and-arrays/destructuring.md @@ -26,20 +26,6 @@ fn print_tuple(tuple: (i32, i32)) { } ``` -This works with any kind of structured value: - -```rust,editable -struct Foo { - a: i32, - b: bool, -} - -fn print_foo(foo: Foo) { - let Foo { a, b } = foo; - println!("a: {a}, b: {b}"); -} -``` -
- The patterns used here are "irrefutable", meaning that the compiler can