From 9257d838bd78a6e5d4ab5ccf8ad205cf60795897 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Mon, 3 Feb 2020 19:29:00 -0500 Subject: [PATCH] Use Result::expect() in test (de)serializations --- zebra-chain/src/block/tests.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/zebra-chain/src/block/tests.rs b/zebra-chain/src/block/tests.rs index 85fffb62..fc363dd5 100644 --- a/zebra-chain/src/block/tests.rs +++ b/zebra-chain/src/block/tests.rs @@ -86,12 +86,13 @@ fn blockheaderhash_from_blockheader() { let mut bytes = Cursor::new(Vec::new()); - // rustc keeps telling me I can't use `?` here, but unwrap() works fine??? - blockheader.zcash_serialize(&mut bytes).unwrap(); + blockheader + .zcash_serialize(&mut bytes) + .expect("these bytes to serialize from a blockheader without issue"); bytes.set_position(0); - // rustc keeps telling me I can't use `?` here, but unwrap() works fine??? - let other_header = BlockHeader::zcash_deserialize(&mut bytes).unwrap(); + let other_header = BlockHeader::zcash_deserialize(&mut bytes) + .expect("these bytes to deserialize into a blockheader without issue"); assert_eq!(blockheader, other_header); }