summaryrefslogtreecommitdiff
path: root/dhall/src/binary.rs
diff options
context:
space:
mode:
authorNadrieril Feneanar2019-04-06 00:43:09 +0200
committerGitHub2019-04-06 00:43:09 +0200
commit5eccde86fc3ccdeb34c9f8bb44de33d25e77f30c (patch)
tree76d0f0fc848887d2945d586b58847575ca31d0da /dhall/src/binary.rs
parentf78af6d1e7f6c1dc39bde6cf97138327004ddb06 (diff)
parent6a675a13fcfafa057c44db84c3b0ca3b344cfdab (diff)
Merge pull request #48 from Nadrieril/exprf
Move recursion out of Expr for enhanced genericity
Diffstat (limited to '')
-rw-r--r--dhall/src/binary.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/dhall/src/binary.rs b/dhall/src/binary.rs
index 235a55b..1ba1873 100644
--- a/dhall/src/binary.rs
+++ b/dhall/src/binary.rs
@@ -1,9 +1,8 @@
use dhall_core::*;
use itertools::*;
use serde_cbor::value::value as cbor;
-use std::rc::Rc;
-type ParsedExpr = Rc<Expr<X, Import>>;
+type ParsedExpr = SubExpr<X, Import>;
#[derive(Debug)]
pub enum DecodeError {
@@ -21,10 +20,10 @@ pub fn decode(data: &[u8]) -> Result<ParsedExpr, DecodeError> {
fn cbor_value_to_dhall(data: &cbor::Value) -> Result<ParsedExpr, DecodeError> {
use cbor::Value::*;
use dhall_core::{BinOp, Builtin, Const};
- use Expr::*;
+ use ExprF::*;
Ok(rc(match data {
String(s) => match Builtin::parse(s) {
- Some(b) => Expr::Builtin(b),
+ Some(b) => ExprF::Builtin(b),
None => match s.as_str() {
"True" => BoolLit(true),
"False" => BoolLit(false),