summaryrefslogtreecommitdiff
path: root/dhall/src/syntax/binary
diff options
context:
space:
mode:
authorNadrieril2020-04-06 22:11:54 +0100
committerNadrieril2020-04-06 22:11:54 +0100
commitfff4c46e09d4edf25eba737f4d71bfdb1dbf4a82 (patch)
tree30f48f45ba0201859193510c65edfd3634764090 /dhall/src/syntax/binary
parentcd3b11cc8bd7c4397071d1d3b4b9020b7d5ff2ad (diff)
Extract operation-related code to a new module
Diffstat (limited to 'dhall/src/syntax/binary')
-rw-r--r--dhall/src/syntax/binary/decode.rs3
-rw-r--r--dhall/src/syntax/binary/encode.rs5
2 files changed, 5 insertions, 3 deletions
diff --git a/dhall/src/syntax/binary/decode.rs b/dhall/src/syntax/binary/decode.rs
index b183f6c..f062089 100644
--- a/dhall/src/syntax/binary/decode.rs
+++ b/dhall/src/syntax/binary/decode.rs
@@ -3,10 +3,11 @@ use serde_cbor::value::value as cbor;
use std::iter::FromIterator;
use crate::error::DecodeError;
+use crate::operations::OpKind;
use crate::syntax;
use crate::syntax::{
Expr, ExprKind, FilePath, FilePrefix, Hash, ImportMode, ImportTarget,
- Integer, InterpolatedText, Label, Natural, NumKind, OpKind, Scheme, Span,
+ Integer, InterpolatedText, Label, Natural, NumKind, Scheme, Span,
UnspannedExpr, URL, V,
};
type DecodedExpr = Expr;
diff --git a/dhall/src/syntax/binary/encode.rs b/dhall/src/syntax/binary/encode.rs
index f2bc6f1..cef2af8 100644
--- a/dhall/src/syntax/binary/encode.rs
+++ b/dhall/src/syntax/binary/encode.rs
@@ -3,11 +3,12 @@ use std::collections::BTreeMap;
use std::vec;
use crate::error::EncodeError;
+use crate::operations::OpKind;
use crate::syntax;
use crate::syntax::map::DupTreeMap;
use crate::syntax::{
Expr, ExprKind, FilePrefix, Hash, Import, ImportMode, ImportTarget, Label,
- OpKind, Scheme, V,
+ Scheme, V,
};
pub fn encode(expr: &Expr) -> Result<Vec<u8>, EncodeError> {
@@ -49,7 +50,7 @@ where
use syntax::Builtin;
use syntax::ExprKind::*;
use syntax::NumKind::*;
- use syntax::OpKind::*;
+ use OpKind::*;
use self::Serialize::{RecordDupMap, RecordMap, UnionMap};
fn expr(x: &Expr) -> self::Serialize<'_> {