Skip to content

Commit

Permalink
automated merge
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Feb 4, 2013
2 parents e08a805 + 159568e commit eb28ce0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 19 deletions.
17 changes: 17 additions & 0 deletions src/libcore/either.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,23 @@ pub pure fn unwrap_right<T,U>(eith: Either<T,U>) -> U {
}

impl<T, U> Either<T, U> {
#[inline(always)]
fn either<V>(&self, f_left: fn(&T) -> V, f_right: fn(&U) -> V) -> V {
either(f_left, f_right, self)
}

#[inline(always)]
fn flip(self) -> Either<U, T> { flip(self) }

#[inline(always)]
fn to_result(self) -> Result<U, T> { to_result(self) }

#[inline(always)]
fn is_left(&self) -> bool { is_left(self) }

#[inline(always)]
fn is_right(&self) -> bool { is_right(self) }

#[inline(always)]
fn unwrap_left(self) -> T { unwrap_left(self) }

Expand Down
35 changes: 16 additions & 19 deletions src/libcore/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,37 @@

/* Reexported core operators */

pub use either::{Either, Left, Right};
pub use kinds::{Const, Copy, Owned, Durable};
pub use ops::{Drop};
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg, Not};
pub use ops::{BitAnd, BitOr, BitXor};
pub use ops::{Drop};
pub use ops::{Shl, Shr, Index};
pub use option::{Option, Some, None};
pub use result::{Result, Ok, Err};

/* Reexported types and traits */

pub use path::Path;
pub use clone::Clone;
pub use cmp::{Eq, Ord};
pub use container::{Container, Mutable, Map, Set};
pub use hash::Hash;
pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
pub use num::Num;
pub use path::GenericPath;
pub use path::WindowsPath;
pub use path::Path;
pub use path::PosixPath;

pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
pub use path::WindowsPath;
pub use pipes::{GenericChan, GenericPort};
pub use ptr::Ptr;
pub use str::{StrSlice, Trimmable};
pub use container::{Container, Mutable};
pub use to_bytes::IterBytes;
pub use to_str::ToStr;
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
pub use vec::{CopyableVector, ImmutableVector};
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
pub use vec::{OwnedVector, OwnedCopyableVector};
pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
pub use container::{Container, Mutable, Map, Set};
pub use pipes::{GenericChan, GenericPort};

pub use num::Num;
pub use ptr::Ptr;
pub use to_str::ToStr;
pub use clone::Clone;

pub use cmp::{Eq, Ord};
pub use hash::Hash;
pub use to_bytes::IterBytes;

/* Reexported modules */

Expand Down

0 comments on commit eb28ce0

Please sign in to comment.