Skip to content

switched RadixHeapMap::push() to return a Result #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ripytide
Copy link

@ripytide ripytide commented Nov 1, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant