Is there a way to destructure a struct partially?

.. as a field in a struct or tuple pattern means “and the rest”:

let ThreeDPoint { x: my_x, y: my_y, .. } = point;

There’s more about this in the Rust Book.

Leave a Comment