From 2a2f3c662f0e62584a8f7a535c3cde30a53d8b0b Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 24 Mar 2019 22:29:52 +0100 Subject: Improve decoder errors on unknown inputs --- dhall/src/binary.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dhall/src/binary.rs b/dhall/src/binary.rs index eb96da2..235a55b 100644 --- a/dhall/src/binary.rs +++ b/dhall/src/binary.rs @@ -323,13 +323,9 @@ fn cbor_value_to_dhall(data: &cbor::Value) -> Result { let y = cbor_value_to_dhall(&y)?; Annot(x, y) } - [U64(t), ..] => Err(DecodeError::WrongFormatError(format!( - "unknown tag: {}", - t - )))?, - _ => Err(DecodeError::WrongFormatError("array".to_owned()))?, + _ => Err(DecodeError::WrongFormatError(format!("{:?}", data)))?, }, - _ => Err(DecodeError::WrongFormatError("unknown type".to_owned()))?, + _ => Err(DecodeError::WrongFormatError(format!("{:?}", data)))?, })) } -- cgit v1.2.3