Skip to content
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

BTreeMap::entry API? #942

Open
dpc opened this issue Jan 31, 2025 · 1 comment
Open

BTreeMap::entry API? #942

dpc opened this issue Jan 31, 2025 · 1 comment

Comments

@dpc
Copy link

dpc commented Jan 31, 2025

If I need to update a record, I think I need to do a get + unwrap_or_default, modify, and then insert? Does it cost me a lookup twice? Would it make sense to have an API like BTreeMap::entry?

@dpc
Copy link
Author

dpc commented Jan 31, 2025

Hmmm... insert_reserve is kind of like it, but I don't see an Option anywhere, and the value_len doesn't seem like what I have.

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

No branches or pull requests

1 participant