Is there an analogous method to
I have an
Iterator and I’m not sure whether it is empty, so I want an
Option of its first element.
I can do the following, because I don’t see a better way.
if (it.isEmpty) None else Some(it.next())
BTW is that the same as:
if (it.hasNext) None else Some(it.next())