]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #22817 - jmesmon:result-or-type, r=huonw
authorManish Goregaokar <manishsmail@gmail.com>
Fri, 27 Feb 2015 06:14:19 +0000 (11:44 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Fri, 27 Feb 2015 16:37:03 +0000 (22:07 +0530)
commitce5f1b3216be790be590ad71eabccc16c9b86c74
tree4c9dfe88dc24c2d581e60905ef2f3aa7ae7c9315
parentef80ade4069aede2e7c08b04556177ce7ea9ae3d
parent07dc8d67c92017f950eef3951ec901cb2a3add7e
Rollup merge of #22817 - jmesmon:result-or-type, r=huonw

 Changes .or() so that it can return a Result with a different E type
than the one it is called on.

Essentially:

    fn or(self, res: Result<T, E>) -> Result<T, E>

becomes

    fn or<F>(self, res: Result<T, F>) -> Result<T, F>

This brings `or` in line with the existing `and` & `or_else`

This is a
[breaking-change]
Due to some code needing additional type annotations.
src/libcore/result.rs