|
|
|
|
|
by Waterluvian
2307 days ago
|
|
The function "consumes" the value. Its no longer valid in the function caller's scope. Often the purpose is to consume the value and return a new kind of value. Maybe `validate_square` takes in `Shape` and returns `Option<Shape>` If valid or invalid, we have consumed the shape so it cant be reused by accident and can't be used without handling the optional branches. I'm new so maybe I'm off on this. |
|