Add IsBool and IsChar to Value trait

This commit is contained in:
Eryn Wells 2017-04-03 16:27:09 -04:00
parent 149f953d11
commit 704c342a6f
2 changed files with 8 additions and 16 deletions

View file

@ -5,7 +5,7 @@
use std::fmt::Debug;
use std::any::Any;
pub trait Value: Debug + ValueEq {
pub trait Value: Debug + ValueEq + IsBool + IsChar {
fn as_value(&self) -> &Value;
}
@ -22,3 +22,10 @@ impl<'lhs,'rhs> PartialEq<Value+'rhs> for Value+'lhs {
}
}
pub trait IsBool {
fn is_bool(&self) -> bool { false }
}
pub trait IsChar {
fn is_char(&self) -> bool { false }
}