summaryrefslogtreecommitdiff
path: root/Why is it called destructuring.md
diff options
context:
space:
mode:
Diffstat (limited to 'Why is it called destructuring.md')
-rw-r--r--Why is it called destructuring.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/Why is it called destructuring.md b/Why is it called destructuring.md
new file mode 100644
index 0000000..6f8945c
--- /dev/null
+++ b/Why is it called destructuring.md
@@ -0,0 +1,8 @@
+[[Rust]]
+
+Destructuring is binding each value in a compound type to a name. It is called destructuring because we break the compound element into individual elements.
+
+```rust
+let tup = (1, 2, 3);
+let (a, b, c) = tup;
+```