Rust Book nightly:
Otherwise, tuple struct instances behave like tuples: you can destructure them into their individual pieces ...
I'm trying to understand destructuring a tuple struct into primitive variables.
struct Point(i32, i32, i32); let origin = Point(0, 0, 0); let (h, w, d) = origin;
error[E0308]: mismatched types --> src/main.rs:109:9 | 109 | let (h, w, d) = origin; | ^^^^^^^^^ ------ this expression has type `main::Point` | | | expected struct `main::Point`, found tuple | = note: expected struct `main::Point` found tuple `(_, _, _)`
The goal here is to recreate h, w and d as individual i32 variables.
Any hints on how to destructure a tuple struct are greatly appreciated.