From 196c144d8f108634b41b54d0d0c10317f154d197 Mon Sep 17 00:00:00 2001 From: Jacob Hummer Date: Tue, 20 Feb 2024 04:48:32 -0600 Subject: [PATCH] fix IndexMap remove() deprecation warning (#3430) --- crates/typst/src/foundations/dict.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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.