From 49e3c29cfb81324b64716cd81dc7e01e2fdba275 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Fri, 29 Apr 2022 13:27:33 +0200 Subject: [PATCH] Better panic explanations --- bee-ledger/src/workers/pruning/batch.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bee-ledger/src/workers/pruning/batch.rs b/bee-ledger/src/workers/pruning/batch.rs index 5e4f6eeb3d..146bbe117a 100644 --- a/bee-ledger/src/workers/pruning/batch.rs +++ b/bee-ledger/src/workers/pruning/batch.rs @@ -332,13 +332,13 @@ fn prune_message_and_metadata( let mut byte_length = 0usize; if by_size { - // Panic: we know the message is in the database. + // Panic: we know the message is in the database, because the caller already made sure of that. let msg = Fetch::::fetch(storage, message_id) .map_err(|e| PruningError::Storage(Box::new(e)))? .unwrap(); byte_length += msg.packed_len(); - // Panic: we know the message metadata is in the database. + // Panic: we know the message metadata is in the database for the same reason as above. let md = Fetch::::fetch(storage, message_id) .map_err(|e| PruningError::Storage(Box::new(e)))? .unwrap();