I started implementing this β librustc is using it much more than I thought. Most of their uses are .iter() then dereferencing, so these become simpler. However the symmetry with other container iterators (also named .iter()) is lost.
I would now say the method needs a rename if we change its calling convention.
Why does librustc use .iter() on Option so often? That should be a rare thing. The only real reason Option supports iteration is to chain with other iterators; anyone using for x in opt.iter() to test and extract a value from an Option is doing it wrong.
Are you saying this because you've decided that iter() is expected to always return a reference? That's typically true of containers that take arbitrary values, but it's not true for containers that hold onto known values. For example, Bitv has an iter() method that returns an Iterator<bool>. EnumSet has an iter() that returns the enumeration values. SmallIntMap has iter() that returns (uint, &T) (i.e. the value is still a reference but the key is an immediate value). And so on.
That said, there is the argument that none of these iter() methods consume the receiver. That argument might be enough to warrant sticking with .move_iter() instead, I'm not sure.
And the highlighted line is an example of where it is now less consistent, because an option was used just like the vec enum field next to it. (This kind of code is quite confusing to edit, since there is no type information for context anywhere close to these lines)
I still feel like this is the clearest pattern for optionally doing something if the Option isn't None, when the result of that operation isn't used further.
.map() or .and_then() are pretty clean ways of doing the same thing and are arguably much clearer than for x in opt.iter(). Even if opt.is_some() { do_something_with(opt.unwrap()) } has a clearer intent.