fix IndexMap remove() deprecation warning (#3430)

This commit is contained in:
Jacob Hummer 2024-02-20 04:48:32 -06:00 committed by GitHub
parent 0fb2a67484
commit 196c144d8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -92,7 +92,9 @@ impl Dict {
/// Remove the value if the dictionary contains the given key.
pub fn take(&mut self, key: &str) -> StrResult<Value> {
Arc::make_mut(&mut self.0).remove(key).ok_or_else(|| missing_key(key))
Arc::make_mut(&mut self.0)
.shift_remove(key)
.ok_or_else(|| missing_key(key))
}
/// Whether the dictionary contains a specific key.