]> git.lizzy.rs Git - rust.git/commit
std: Add .consume_iter() for Option, to make it reusable
authorblake2-ppc <blake2-ppc>
Sat, 3 Aug 2013 17:40:20 +0000 (19:40 +0200)
committerblake2-ppc <blake2-ppc>
Tue, 6 Aug 2013 01:59:56 +0000 (03:59 +0200)
commitce682cb45ff6f899d478358d7517fa83b215ac3c
tree6bdf0ea09f1a02231d0eec6f2c237373faa255b9
parentbbda3fa9383dba653b20bd064102caceef91897a
std: Add .consume_iter() for Option, to make it reusable

Let Option be a base for a widely useful one- or zero- item iterator.
Refactor OptionIterator to support any generic element type, so the same
iterator impl can be used for both &T, &mut T and T iterators.
src/libstd/option.rs