mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 13:55:23 +01:00
Added struct de-structure-ing example in tips & tricks
This commit is contained in:
parent
72e84cb297
commit
76e234599f
2 changed files with 56 additions and 0 deletions
|
|
@ -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}}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue