Skip to content
Snippets Groups Projects
Commit 6ee82734 authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

keep error messages in FEC tests (dragoon/komodo!4)

follow up to !3

## description
in !3, to make Clippy happy, `expect` was replace with `unwrap_or_else`, but that suppresses the message of the underlying error, which is not great...

this MR reverts this part of !3 and allows `clippy::expect_fun_call`.
parent 1f879c79
No related branches found
No related tags found
No related merge requests found
......@@ -291,6 +291,7 @@ mod tests {
125, 10, 125, 10,
];
#[allow(clippy::expect_fun_call)]
fn decoding_template<E: Pairing>(data: &[u8], k: usize, n: usize) {
let hash = Sha256::hash(data).to_vec();
......@@ -305,11 +306,14 @@ mod tests {
.map(|c| c.to_vec())
.collect(),
)
.unwrap_or_else(|_| panic!("could not build source shard matrix ({} bytes)", data.len()));
.expect(&format!(
"could not build source shard matrix ({} bytes)",
data.len()
));
let shards = source_shards
.mul(&encoding)
.unwrap_or_else(|_| panic!("could not encode shards ({} bytes)", data.len()))
.expect(&format!("could not encode shards ({} bytes)", data.len()))
.transpose()
.elements
.chunks(source_shards.height)
......@@ -328,8 +332,7 @@ mod tests {
assert_eq!(
data,
decode::<E>(shards)
.unwrap_or_else(|_| panic!("could not decode shards ({} bytes)", data.len()))
decode::<E>(shards).expect(&format!("could not decode shards ({} bytes)", data.len()))
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment