diff options
| -rw-r--r-- | crates/typst/src/foundations/dict.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/typst/src/foundations/dict.rs b/crates/typst/src/foundations/dict.rs index 59dd85c7..06c8f0e4 100644 --- a/crates/typst/src/foundations/dict.rs +++ b/crates/typst/src/foundations/dict.rs @@ -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. |
