From 5692bf2c8a7acfb90a5d03d0bd360c105ba2a72b Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 16 Mar 2019 00:18:50 +0100 Subject: Store an Option in OptionalLit instead of a vec Closes #21 --- dhall/src/binary.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'dhall/src/binary.rs') 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 { } [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)?); -- cgit v1.2.3