diff options
Diffstat (limited to 'book/en/src/by-example/tips.md')
| -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}} +``` |
