Skip to content

Commit eb28ce0

Browse files
committed
automated merge
2 parents e08a805 + 159568e commit eb28ce0

File tree

2 files changed

+33
-19
lines changed

2 files changed

+33
-19
lines changed

src/libcore/either.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,23 @@ pub pure fn unwrap_right<T,U>(eith: Either<T,U>) -> U {
150150
}
151151

152152
impl<T, U> Either<T, U> {
153+
#[inline(always)]
154+
fn either<V>(&self, f_left: fn(&T) -> V, f_right: fn(&U) -> V) -> V {
155+
either(f_left, f_right, self)
156+
}
157+
158+
#[inline(always)]
159+
fn flip(self) -> Either<U, T> { flip(self) }
160+
161+
#[inline(always)]
162+
fn to_result(self) -> Result<U, T> { to_result(self) }
163+
164+
#[inline(always)]
165+
fn is_left(&self) -> bool { is_left(self) }
166+
167+
#[inline(always)]
168+
fn is_right(&self) -> bool { is_right(self) }
169+
153170
#[inline(always)]
154171
fn unwrap_left(self) -> T { unwrap_left(self) }
155172

src/libcore/prelude.rs

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,37 @@
1212

1313
/* Reexported core operators */
1414

15+
pub use either::{Either, Left, Right};
1516
pub use kinds::{Const, Copy, Owned, Durable};
16-
pub use ops::{Drop};
1717
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg, Not};
1818
pub use ops::{BitAnd, BitOr, BitXor};
19+
pub use ops::{Drop};
1920
pub use ops::{Shl, Shr, Index};
2021
pub use option::{Option, Some, None};
2122
pub use result::{Result, Ok, Err};
2223

2324
/* Reexported types and traits */
2425

25-
pub use path::Path;
26+
pub use clone::Clone;
27+
pub use cmp::{Eq, Ord};
28+
pub use container::{Container, Mutable, Map, Set};
29+
pub use hash::Hash;
30+
pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
31+
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
32+
pub use num::Num;
2633
pub use path::GenericPath;
27-
pub use path::WindowsPath;
34+
pub use path::Path;
2835
pub use path::PosixPath;
29-
30-
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
36+
pub use path::WindowsPath;
37+
pub use pipes::{GenericChan, GenericPort};
38+
pub use ptr::Ptr;
3139
pub use str::{StrSlice, Trimmable};
32-
pub use container::{Container, Mutable};
40+
pub use to_bytes::IterBytes;
41+
pub use to_str::ToStr;
42+
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
3343
pub use vec::{CopyableVector, ImmutableVector};
3444
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
3545
pub use vec::{OwnedVector, OwnedCopyableVector};
36-
pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
37-
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
38-
pub use container::{Container, Mutable, Map, Set};
39-
pub use pipes::{GenericChan, GenericPort};
40-
41-
pub use num::Num;
42-
pub use ptr::Ptr;
43-
pub use to_str::ToStr;
44-
pub use clone::Clone;
45-
46-
pub use cmp::{Eq, Ord};
47-
pub use hash::Hash;
48-
pub use to_bytes::IterBytes;
4946

5047
/* Reexported modules */
5148

0 commit comments

Comments
 (0)