aboutsummaryrefslogtreecommitdiff
path: root/book/en/src/by-example/tips/destructureing.md
diff options
context:
space:
mode:
authordatdenkikniet <jcdra1@gmail.com>2023-04-23 13:22:35 +0200
committerdatdenkikniet <jcdra1@gmail.com>2023-05-11 19:20:58 +0200
commite51146a98cc7c83ea574d13b4b5d8e7ceeeb004b (patch)
tree2c177aa08778c51167835278d4d3e0c777d03019 /book/en/src/by-example/tips/destructureing.md
parentcb0ceea472f33ed7a8b17fe7e0b98f24927d9185 (diff)
Move tips into their own subdir
Diffstat (limited to 'book/en/src/by-example/tips/destructureing.md')
-rw-r--r--book/en/src/by-example/tips/destructureing.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/book/en/src/by-example/tips/destructureing.md b/book/en/src/by-example/tips/destructureing.md
new file mode 100644
index 0000000..6e1d796
--- /dev/null
+++ b/book/en/src/by-example/tips/destructureing.md
@@ -0,0 +1,15 @@
+# Resource de-structure-ing
+
+Destructuring task resources might help readability if a task takes multiple
+resources. Here are two examples on how to split up the resource struct:
+
+``` rust
+{{#include ../../../../../rtic/examples/destructure.rs}}
+```
+
+``` console
+$ cargo run --target thumbv7m-none-eabi --example destructure
+```
+``` console
+{{#include ../../../../../rtic/ci/expected/destructure.run}}
+```