Simplify number/mod.rs a bunch

This commit is contained in:
Eryn Wells 2017-04-22 09:30:45 -07:00
parent 61f8cfccb5
commit 4274822b65

View file

@ -7,15 +7,12 @@
/// Scheme numbers are complex, literally. /// Scheme numbers are complex, literally.
pub mod real; pub mod real;
pub mod complex; //pub mod complex;
mod add; //mod add;
mod math; mod math;
pub use self::real::Real; pub use self::real::Real;
pub use self::complex::Complex; //pub use self::complex::Complex;
use std::any::Any;
use value::*;
type Int = i64; type Int = i64;
type Flt = f64; type Flt = f64;
@ -67,21 +64,6 @@ impl Number {
pub fn is_exact(&self) -> bool { self.exact } pub fn is_exact(&self) -> bool { self.exact }
} }
impl Value for Number {
fn as_value(&self) -> &Value { self }
}
impl ValueEq for Number {
fn eq(&self, other: &Value) -> bool {
other.as_any().downcast_ref::<Self>().map_or(false, |x| x == self)
}
fn as_any(&self) -> &Any { self }
}
impl IsBool for Number { }
impl IsChar for Number { }
impl IsNumber for Number { }
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::Number; use super::Number;