aboutsummaryrefslogtreecommitdiff
path: root/src/sexp/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sexp/util.rs')
-rw-r--r--src/sexp/util.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sexp/util.rs b/src/sexp/util.rs
index f01dab9..b3edf19 100644
--- a/src/sexp/util.rs
+++ b/src/sexp/util.rs
@@ -12,6 +12,12 @@ impl From<i32> for Box<SExp> {
}
}
+impl From<bool> for SExp {
+ fn from(bl: bool) -> Self {
+ Atom( if bl { True } else { False } )
+ }
+}
+
impl From<SLeaf> for Box<SExp> {
fn from(leaf: SLeaf) -> Self {
Box::new(Atom(leaf))