Skip to content

Commit

Permalink
Removed destructuring about struct (#1924)
Browse files Browse the repository at this point in the history
#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)).
  • Loading branch information
mani-chand authored Mar 19, 2024
1 parent b06cc21 commit e5e33a1
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/tuples-and-arrays/destructuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
}
```

<details>

- The patterns used here are "irrefutable", meaning that the compiler can
Expand Down

0 comments on commit e5e33a1

Please sign in to comment.