Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Options can be mapped/zipped/“iterated” over (traversed might be a better word?).

So in this case it’s using that fact to form a tuple of non-null values whenever the option is not null, and then acting on that. I think it’s kinda neat, but I wouldn’t personally use zip in this case, I’d have gone with map or and_then depending on whether the output of my operation is T or Option<T>.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: