Entry API, convert from occupied to vacant during removal

⚓ Rust    📅 2025-12-11    👤 surdeus    👁️ 12      

surdeus

Warning

This post was published 58 days ago. The information described in this article may have changed.

Hi, is anyone familiar as to why there's no single method for converting from an occupied entry to a vacant one during the removal operation? Would it be by any chance unsound to perform occupied.remove_and_vacate() which would return the original value along with the VacantEntry?

My question arose while I was trying "update or insert" using the entry api.
Note, I don't do this for performance reasons. Its the no-error-path behaviour that matters for me.

3 posts - 3 participants

Read full topic

🏷️ Rust_feed