mozilla/rust — pull request #11098 by erickt (2013-12-21 05:36:37+00:00)
Title: change result::collect to take an iterator, and adds option::collect

This patch changes `result::collect` (and adds a new `option::collect`) from creating a `~[T]` to take an `Iterator`. This makes the function much more flexible, and may replace the need for #10989.

This patch is a little more complicated than it needs to be because of #11084. Once that is fixed we can replace the `CollectIterator` with a `Scan` iterator.

It also fixes a test warning.