summaryrefslogtreecommitdiff
path: root/src/eval/dict.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-06-14 15:07:13 +0200
committerLaurenz <laurmaedje@gmail.com>2022-06-14 17:17:54 +0200
commit7a6c2cce7747f7632f0be012f49b548db3e62a2d (patch)
tree30103d743fcf22c6838e5ce3b6c632abe15e78b9 /src/eval/dict.rs
parent6832ca2a26df5a9407bd2b0266cc0bab328ebeba (diff)
Make radius configuration unconfusing
Diffstat (limited to 'src/eval/dict.rs')
-rw-r--r--src/eval/dict.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/eval/dict.rs b/src/eval/dict.rs
index 8893ce48..654c90eb 100644
--- a/src/eval/dict.rs
+++ b/src/eval/dict.rs
@@ -76,6 +76,11 @@ impl Dict {
}
}
+ /// Remove the value if the dictionary contains the given key.
+ pub fn take(&mut self, key: &str) -> Option<Value> {
+ Arc::make_mut(&mut self.0).remove(key)
+ }
+
/// Clear the dictionary.
pub fn clear(&mut self) {
if Arc::strong_count(&self.0) == 1 {