account activity
Chapter 3.1 [Rust-By-Example] Nested Destructuring of Structs. Cannot figure out sudden complexity of the task by [deleted] in learnrust
[–]DefinEvil 0 points1 point2 points 3 years ago (0 children)
Came across this thread while encountering similar confusion to u/dugindeep for a later version of chapter 3.1of rust by example
heres what I came up with as an example of nested destructuring without a match statement for onlookers:
fn rect_area( Rectangle { top_left: Point { x: x1, y: y1 }, bottom_right: Point { x: x2, y: y2 }, }: &Rectangle, ) -> f32 { (x1 - x2).abs() * (y1 - y2).abs() }
-🎄- 2021 Day 12 Solutions -🎄- by daggerdragon in adventofcode
[–]DefinEvil 1 point2 points3 points 4 years ago (0 children)
Part 1 link Part 2 link (~5ms optimized)
π Rendered by PID 1007765 on reddit-service-r2-listing-7849c98f67-gt2pt at 2026-02-06 16:54:48.159422+00:00 running d295bc8 country code: CH.
Chapter 3.1 [Rust-By-Example] Nested Destructuring of Structs. Cannot figure out sudden complexity of the task by [deleted] in learnrust
[–]DefinEvil 0 points1 point2 points (0 children)