diff --git a/crates/typst/src/foundations/dict.rs b/crates/typst/src/foundations/dict.rs index 59dd85c7b..06c8f0e48 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 { - 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.