diff options
| author | Emil Fresk <emil.fresk@gmail.com> | 2019-11-07 14:12:16 +0100 |
|---|---|---|
| committer | Emil Fresk <emil.fresk@gmail.com> | 2019-11-07 14:12:16 +0100 |
| commit | 76e234599f6da0b7ee21b98da80201a3984ee323 (patch) | |
| tree | c3153c9227a63e31164cd2deb1ecdef152c8b561 /book | |
| parent | 72e84cb297ef06d9496d18402bc8ea2d88cd1665 (diff) | |
Added struct de-structure-ing example in tips & tricks
Diffstat (limited to 'book')
| -rw-r--r-- | book/en/src/by-example/tips.md | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/book/en/src/by-example/tips.md b/book/en/src/by-example/tips.md index a008206..b923ed0 100644 --- a/book/en/src/by-example/tips.md +++ b/book/en/src/by-example/tips.md @@ -165,3 +165,12 @@ crate and print the output to the console. $ # produces the same output as before $ cargo expand --example smallest | tail ``` + +## Resource de-structure-ing + +When having a task taking multiple resources it can help in readability to split +up the resource struct. Here're two examples on how this can be done: + +``` rust +{{#include ../../../../examples/destructure.rs}} +``` |
