radix-heap icon indicating copy to clipboard operation
radix-heap copied to clipboard

switched `RadixHeapMap::push()` to return a Result

Open ripytide opened this issue 2 years ago • 0 comments

Switched RadixHeapMap::push() to return a Result rather than simply panicking when given a greater key than the current top key.

This is a nicer API to work with as it allows the caller to choose how they want to handle such an error rather than being forced to panic.

The use-case that inspired this change was I was trying to debug a scenario when a greater key was given by catching the faulty push and doing some dbg!()s but I was unable to since push() panics internally.

ripytide avatar Nov 01 '23 12:11 ripytide