Rust: Struct Destructuring to Extract Values From Tuple Structs

Rating: 4

You can use struct destructuring to extract a value from a tuple struct.

let some_id = SomeId(42);
let SomeId(id) = some_id;
More Info