summaryrefslogtreecommitdiff
path: root/dhall/src/binary.rs
diff options
context:
space:
mode:
authorNadrieril2019-03-16 00:18:50 +0100
committerNadrieril2019-03-16 00:18:50 +0100
commit5692bf2c8a7acfb90a5d03d0bd360c105ba2a72b (patch)
treeb86ac0beeb06cb9984f1d6a2ba547d391674533e /dhall/src/binary.rs
parent1522469dc0b68c63dbbc81faab057c3d48402657 (diff)
Store an Option in OptionalLit instead of a vec
Closes #21
Diffstat (limited to '')
-rw-r--r--dhall/src/binary.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/dhall/src/binary.rs b/dhall/src/binary.rs
index 694043b..cc07431 100644
--- a/dhall/src/binary.rs
+++ b/dhall/src/binary.rs
@@ -104,16 +104,16 @@ fn cbor_value_to_dhall(data: &cbor::Value) -> Result<ParsedExpr, DecodeError> {
}
[U64(5), t] => {
let t = bx(cbor_value_to_dhall(&t)?);
- Ok(OptionalLit(Some(t), vec![]))
+ Ok(OptionalLit(Some(t), None))
}
[U64(5), Null, x] => {
- let x = cbor_value_to_dhall(&x)?;
- Ok(OptionalLit(None, vec![x]))
+ let x = bx(cbor_value_to_dhall(&x)?);
+ Ok(OptionalLit(None, Some(x)))
}
[U64(5), t, x] => {
- let x = cbor_value_to_dhall(&x)?;
+ let x = bx(cbor_value_to_dhall(&x)?);
let t = bx(cbor_value_to_dhall(&t)?);
- Ok(OptionalLit(Some(t), vec![x]))
+ Ok(OptionalLit(Some(t), Some(x)))
}
[U64(6), x, y] => {
let x = bx(cbor_value_to_dhall(&x)?);