[types] Implement From<bool> for Bool
This commit is contained in:
parent
fe478fadc7
commit
3a7fe94b32
1 changed files with 10 additions and 0 deletions
|
@ -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 {
|
impl PartialEq<Obj> for Bool {
|
||||||
fn eq(&self, rhs: &Obj) -> bool {
|
fn eq(&self, rhs: &Obj) -> bool {
|
||||||
match rhs {
|
match rhs {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue