summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/phase/binary.rs
diff options
context:
space:
mode:
authorNadrieril2019-12-15 19:56:54 +0000
committerNadrieril2019-12-15 19:56:54 +0000
commit0105e3c31dbb2984e5c4b9d51cc3b27767e7683c (patch)
tree0e0a5eff865529fec1709201d241bd99ca14baba /dhall/src/semantics/phase/binary.rs
parentec761bbd0de807bf1cb0da9389d714e3d812dd6d (diff)
Avoid mention of `crate::` outside of top-level imports
Diffstat (limited to '')
-rw-r--r--dhall/src/semantics/phase/binary.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/dhall/src/semantics/phase/binary.rs b/dhall/src/semantics/phase/binary.rs
index 1fc41d4..a38f08a 100644
--- a/dhall/src/semantics/phase/binary.rs
+++ b/dhall/src/semantics/phase/binary.rs
@@ -3,6 +3,9 @@ use serde_cbor::value::value as cbor;
use std::iter::FromIterator;
use std::vec;
+use crate::error::{DecodeError, EncodeError};
+use crate::phase::DecodedExpr;
+use crate::syntax;
use crate::syntax::map::DupTreeMap;
use crate::syntax::{
Expr, ExprF, FilePath, FilePrefix, Hash, Import, ImportLocation,
@@ -10,9 +13,6 @@ use crate::syntax::{
Span, URL, V,
};
-use crate::error::{DecodeError, EncodeError};
-use crate::phase::DecodedExpr;
-
pub(crate) fn decode(data: &[u8]) -> Result<DecodedExpr, DecodeError> {
match serde_cbor::de::from_slice(data) {
Ok(v) => cbor_value_to_dhall(&v),
@@ -31,8 +31,8 @@ pub fn rc<E>(x: RawExpr<E>) -> Expr<E> {
}
fn cbor_value_to_dhall(data: &cbor::Value) -> Result<DecodedExpr, DecodeError> {
- use crate::syntax::{BinOp, Builtin, Const};
use cbor::Value::*;
+ use syntax::{BinOp, Builtin, Const};
use ExprF::*;
Ok(rc(match data {
String(s) => match Builtin::parse(s) {
@@ -350,7 +350,7 @@ fn cbor_value_to_dhall(data: &cbor::Value) -> Result<DecodedExpr, DecodeError> {
"import/type".to_owned(),
))?,
};
- Import(crate::syntax::Import {
+ Import(syntax::Import {
mode,
hash,
location,
@@ -472,10 +472,10 @@ fn serialize_subexpr<S, E>(ser: S, e: &Expr<E>) -> Result<S::Ok, S::Error>
where
S: serde::ser::Serializer,
{
- use crate::syntax::Builtin;
- use crate::syntax::ExprF::*;
use cbor::Value::{String, I64, U64};
use std::iter::once;
+ use syntax::Builtin;
+ use syntax::ExprF::*;
use self::Serialize::{RecordMap, UnionMap};
fn expr<E>(x: &Expr<E>) -> self::Serialize<'_, E> {
@@ -548,7 +548,7 @@ where
once(tag(4)).chain(once(null())).chain(xs.iter().map(expr)),
),
TextLit(xs) => {
- use crate::syntax::InterpolatedTextContents::{Expr, Text};
+ use syntax::InterpolatedTextContents::{Expr, Text};
ser.collect_seq(once(tag(18)).chain(xs.iter().map(|x| match x {
Expr(x) => expr(x),
Text(x) => cbor(String(x.clone())),
@@ -559,7 +559,7 @@ where
UnionType(map) => ser_seq!(ser; tag(11), UnionMap(map)),
Field(x, l) => ser_seq!(ser; tag(9), expr(x), label(l)),
BinOp(op, x, y) => {
- use crate::syntax::BinOp::*;
+ use syntax::BinOp::*;
let op = match op {
BoolOr => 0,
BoolAnd => 1,