aboutsummaryrefslogtreecommitdiff
path: root/book/en/src/by-example/tips_destructureing.md
blob: 7b864c466625f0663b230f40f6c1eb60bed66975 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Resource de-structure-ing

When having a task taking multiple resources it can help in readability to split
up the resource struct. Here are two examples on how this can be done:

``` rust
{{#include ../../../../examples/destructure.rs}}
```

``` console
$ cargo run --target thumbv7m-none-eabi --example destructure
{{#include ../../../../ci/expected/destructure.run}}
```