Going through rustlings for the first time
Rust
100.0%
17
1
0
Clone this repository
https://tangled.org/chay.dev/rustlings
https://tangled.org/did:plc:lt7ednqopmbndqy7y4p72yjs/rustlings
git@tangled.org:chay.dev/rustlings
git@tangled.org:did:plc:lt7ednqopmbndqy7y4p72yjs/rustlings
For self-hosted knots, clone URLs may differ based on your setup.
Download tar.gz
options3 is a little harder to grok: the key is to understand that pattern
matching is a form of assignment, so matching on optional_point to Some(p)
actually moves the Point out of the Option into the variable `p`.
Of the two solutions, I think I'd prefer matching on &optional_point because it
feels more explicit that we are borrowing during the Some(p) pattern matching.