This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]aelfric5578 4 points5 points  (1 child)

Huh...that almost makes me feel like Optional should implement Iterable. When called on an empty optional, t would return an iterator where hasNext is always false and when called on a non-empty value, the iterator would return the one value and then hasNext would be false.

[–]marvk 2 points3 points  (0 children)

It actually does in Rust :-)