don't calculate panic message eagerly
This commit is contained in:
@@ -481,11 +481,13 @@ pub(crate) use heap_index_checked;
|
|||||||
macro_rules! heap_index {
|
macro_rules! heap_index {
|
||||||
($idx:expr) => {{
|
($idx:expr) => {{
|
||||||
let idx = $idx;
|
let idx = $idx;
|
||||||
$crate::macros::heap_index_checked!(idx).expect(&format!(
|
$crate::macros::heap_index_checked!(idx).unwrap_or_else(|| {
|
||||||
"overflow while calculating heap index {idx} * {} > {}",
|
panic!(
|
||||||
std::mem::size_of::<HeapCellValue>(),
|
"overflow while calculating heap index {idx} * {} > {}",
|
||||||
usize::MAX,
|
std::mem::size_of::<HeapCellValue>(),
|
||||||
))
|
usize::MAX,
|
||||||
|
)
|
||||||
|
})
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user