#027
Jan 1, 2023
27. Option's sum/product
Rust’s option implements Sum and Product traits too!
Use it when you want to get None if there is a None element and sum of values otherwise.
| |
or sum of the values …
| |
And product.
| |
Rust’s option implements Sum and Product traits too!
Use it when you want to get None if there is a None element and sum of values otherwise.
| |
or sum of the values …
| |
And product.
| |