mozilla/rust — pull request #8268 by Kimundi (2013-08-03 21:40:16+00:00)
Title: Updated std::Option, std::Either and std::Result

- Lifted the quality of the either and result module to that of option
- Made naming schemes consistent between Option, Result and Either

I also touched up on two issues that haven't yet reached a real consensus, so it wouldn't wonder me if this PR doesn't go through uncontested:

- Changed Options Add implementation to work like the maybe Monad (return None if any of the inputs is None)
See https://github.com/mozilla/rust/issues/6002, especially my last comment.
- Renamed Option::unwrap to Option::get and Option::take_unwrap to Option::take_get
See also https://github.com/mozilla/rust/issues/7887, In my opinion, at least for these enums, `get` as unwrap operation, and `get_ref` as take-reference operation seem to make most sense.

Todo:

Adding testcases for all function in the three modules. Even without the few functions I added, the coverage wasn't complete to begin with. But I'd rather do that as a follow up PR, I've touched to much code here already, need to go through them again with a clear mind.