|
|
|
|
|
by saagarjha
2258 days ago
|
|
> What would fold do on an option, specifically? Fold is usually a list operation, but an option is a list of zero or one... so it would be a no-op? Presumably the fold takes advantage of the fact that the default, "accumulator" value is chosen if the Option is empty and the collapse function just runs what would be the Some arm of the match statement. |
|
Thats https://doc.rust-lang.org/stable/std/option/enum.Option.html..., I think?