[types] Implement From<bool> for Bool

This commit is contained in:
Eryn Wells 2018-08-26 17:41:50 -07:00
parent fe478fadc7
commit 3a7fe94b32

View file

@ -25,6 +25,16 @@ impl fmt::Display for Bool {
}
}
impl From<bool> for Bool {
fn from(value: bool) -> Self {
if value {
Bool::True
} else {
Bool::False
}
}
}
impl PartialEq<Obj> for Bool {
fn eq(&self, rhs: &Obj) -> bool {
match rhs {