mozilla/rust — pull request #9115 by erickt (2013-09-11 05:13:04+00:00)
Title: Modernizing parts of Option and Result

This is a series of patches to modernize option and result. The highlights are:

* rename `.unwrap_or_default(value)` and etc to `.unwrap_or(value)`
* add `.unwrap_or_default()` that uses the `Default` trait
* add `Default` implementations for vecs, HashMap, Option
* add `Option.and(T) -> Option`, `Option.and_then(&fn() -> Option) -> Option`, `Option.or(T) -> Option`, and `Option.or_else(&fn() -> Option) -> Option`
* add `option::ToOption`, `option::IntoOption`, `result::ToResult`, `result::IntoResult`, `either::ToEither`, and `either::IntoEither`