Update to the last rust-nightly.

Version of rustc: 0.13.0-nightly (336349c93 2014-11-17 20:37:19 +0000).
This commit is contained in:
Sébastien Crozet 2014-11-19 12:11:32 +01:00
parent 77348f668f
commit d8dfedbf99
7 changed files with 28 additions and 32 deletions

View File

@ -109,7 +109,6 @@ extern crate serialize;
extern crate test;
use std::cmp;
pub use traits::{PartialLess, PartialEqual, PartialGreater, NotComparable};
pub use traits::{
Absolute,
AbsoluteRotate,

View File

@ -5,8 +5,7 @@
use std::mem;
use std::slice::{Items, MutItems};
use std::iter::{Iterator, FromIterator};
use traits::operations::{ApproxEq, POrd, POrdering, PartialLess, PartialEqual,
PartialGreater, NotComparable, Axpy, ScalarAdd, ScalarSub, ScalarMul,
use traits::operations::{ApproxEq, POrd, POrdering, Axpy, ScalarAdd, ScalarSub, ScalarMul,
ScalarDiv};
use traits::structure::{Cast, Dim, Indexable, Iterable, IterableMut, PntAsVec, Shape,
NumPnt, FloatPnt, BaseFloat, BaseNum, Zero, One, Bounded};

View File

@ -7,8 +7,7 @@ use std::num;
use std::rand::{Rand, Rng};
use std::slice::{Items, MutItems};
use structs::{Vec3, Pnt3, Rot3, Mat3, Vec3MulRhs, Pnt3MulRhs};
use traits::operations::{ApproxEq, Inv, POrd, POrdering, NotComparable, PartialLess,
PartialGreater, PartialEqual, Axpy, ScalarAdd, ScalarSub, ScalarMul,
use traits::operations::{ApproxEq, Inv, POrd, POrdering, Axpy, ScalarAdd, ScalarSub, ScalarMul,
ScalarDiv};
use traits::structure::{Cast, Indexable, Iterable, IterableMut, Dim, Shape, BaseFloat, BaseNum, Zero,
One, Bounded};

View File

@ -5,8 +5,7 @@
use std::mem;
use std::slice::{Items, MutItems};
use std::iter::{Iterator, FromIterator};
use traits::operations::{ApproxEq, POrd, POrdering, PartialLess, PartialEqual,
PartialGreater, NotComparable, Axpy, ScalarAdd, ScalarSub, ScalarMul,
use traits::operations::{ApproxEq, POrd, POrdering, Axpy, ScalarAdd, ScalarSub, ScalarMul,
ScalarDiv, Absolute};
use traits::geometry::{Transform, Rotate, FromHomogeneous, ToHomogeneous, Dot, Norm,
Translation, Translate};

View File

@ -80,16 +80,16 @@ macro_rules! ord_impl(
if is_lt { // <
$(
if a.$compN > b.$compN {
return NotComparable
return POrdering::NotComparable
}
)*
PartialLess
POrdering::PartialLess
}
else { // >=
$(
if a.$compN < b.$compN {
return NotComparable
return POrdering::NotComparable
}
else if a.$compN > b.$compN {
is_eq = false;
@ -98,10 +98,10 @@ macro_rules! ord_impl(
)*
if is_eq {
PartialEqual
POrdering::PartialEqual
}
else {
PartialGreater
POrdering::PartialGreater
}
}
}

View File

@ -11,7 +11,7 @@ pub use traits::structure::{FloatVec, FloatPnt, Basis, Cast, Col, Dim, Indexable
pub use traits::operations::{Absolute, ApproxEq, Axpy, Cov, Det, Inv, LMul, Mean, Outer, POrd,
RMul, ScalarAdd, ScalarSub, ScalarMul, ScalarDiv, Transpose, EigenQR};
pub use traits::operations::{POrdering, PartialLess, PartialEqual, PartialGreater, NotComparable};
pub use traits::operations::POrdering;
pub mod geometry;
pub mod structure;

View File

@ -19,40 +19,40 @@ pub enum POrdering {
impl POrdering {
/// Returns `true` if `self` is equal to `Equal`.
pub fn is_eq(&self) -> bool {
*self == PartialEqual
*self == POrdering::PartialEqual
}
/// Returns `true` if `self` is equal to `Less`.
pub fn is_lt(&self) -> bool {
*self == PartialLess
*self == POrdering::PartialLess
}
/// Returns `true` if `self` is equal to `Less` or `Equal`.
pub fn is_le(&self) -> bool {
*self == PartialLess || *self == PartialEqual
*self == POrdering::PartialLess || *self == POrdering::PartialEqual
}
/// Returns `true` if `self` is equal to `Greater`.
pub fn is_gt(&self) -> bool {
*self == PartialGreater
*self == POrdering::PartialGreater
}
/// Returns `true` if `self` is equal to `Greater` or `Equal`.
pub fn is_ge(&self) -> bool {
*self == PartialGreater || *self == PartialEqual
*self == POrdering::PartialGreater || *self == POrdering::PartialEqual
}
/// Returns `true` if `self` is equal to `NotComparable`.
pub fn is_not_comparable(&self) -> bool {
*self == NotComparable
*self == POrdering::NotComparable
}
/// Creates a `POrdering` from an `Ordering`.
pub fn from_ordering(ord: Ordering) -> POrdering {
match ord {
Less => PartialLess,
Equal => PartialEqual,
Greater => PartialGreater
Less => POrdering::PartialLess,
Equal => POrdering::PartialEqual,
Greater => POrdering::PartialGreater
}
}
@ -61,10 +61,10 @@ impl POrdering {
/// Returns `None` if `self` is `NotComparable`.
pub fn to_ordering(self) -> Option<Ordering> {
match self {
PartialLess => Some(Less),
PartialEqual => Some(Equal),
PartialGreater => Some(Greater),
NotComparable => None
POrdering::PartialLess => Some(Less),
POrdering::PartialEqual => Some(Equal),
POrdering::PartialGreater => Some(Greater),
POrdering::NotComparable => None
}
}
}
@ -108,9 +108,9 @@ pub trait POrd {
#[inline]
fn partial_min<'a>(a: &'a Self, b: &'a Self) -> Option<&'a Self> {
match POrd::partial_cmp(a, b) {
PartialLess | PartialEqual => Some(a),
PartialGreater => Some(b),
NotComparable => None
POrdering::PartialLess | POrdering::PartialEqual => Some(a),
POrdering::PartialGreater => Some(b),
POrdering::NotComparable => None
}
}
@ -118,9 +118,9 @@ pub trait POrd {
#[inline]
fn partial_max<'a>(a: &'a Self, b: &'a Self) -> Option<&'a Self> {
match POrd::partial_cmp(a, b) {
PartialGreater | PartialEqual => Some(a),
PartialLess => Some(b),
NotComparable => None
POrdering::PartialGreater | POrdering::PartialEqual => Some(a),
POrdering::PartialLess => Some(b),
POrdering::NotComparable => None
}
}