Skip to content

Commit

Permalink
Use shift_remove with IndexMap
Browse files Browse the repository at this point in the history
This fixes a deprecation warning as the `remove` method had been
deprecated in favor of either `swap_remove` or `shift_remove`.

It seems appropriate to use `shift_remove` here to preserve ordering.
  • Loading branch information
waywardmonkeys committed Dec 6, 2024
1 parent 4dc1516 commit 5668f36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ impl PrefixMapping {
///
/// * [`PrefixMapping::add_prefix()`]
pub fn remove_prefix(&mut self, prefix: &str) {
self.mapping.remove(prefix);
self.mapping.shift_remove(prefix);
}

/// Expand a CURIE, returning a complete IRI.
Expand Down

0 comments on commit 5668f36

Please sign in to comment.