mozilla/rust — pull request #10119 by Kimundi (2013-10-28 09:50:20+00:00)
Title: RFC: Made Option and Results methods more similar

This PR applies the last reform on the `Option` type (`as_ref` adapters), and applies them to `Result` too.
For that, I reordered and grouped the functions in both modules, and also did some refactorings:

- Renamed the `Result` methods on `Err` values from `NAME_err`
to `err_NAME` to make the methods flow better into the argument.
Compare `res.err_unwrap_or(foo)` and `res.unwrap_or_err(foo)`
- Renamed `map_default` to `map_or` to make it more similar to the
boolean logic like naming conventions already in use, and to
make it not confusing in regard to the `Default` trait.
Instead, there could be `NAME_default` methods that use that trait.
- Added more methods on `Result` to make it equal with `Option` for
non option specific operations.
- Made the `.expect()` methods be generic over anything you can fail with