Skip to content

Commit

Permalink
Fix indemap deprecated API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Mar 5, 2024
1 parent 92fc9bb commit 0f6aea1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/value/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ impl Map {

/// Removes an element by its `key`.
pub fn remove(&mut self, key: &Value) -> Option<Value> {
self.0.remove(key)
#[cfg(feature = "indexmap")]
{
self.0.shift_remove(key)
}
#[cfg(not(feature = "indexmap"))]
{
self.0.remove(key)
}
}

/// Iterate all key-value pairs.
Expand Down

0 comments on commit 0f6aea1

Please sign in to comment.