diff options
Diffstat (limited to 'src/eval/dict.rs')
| -rw-r--r-- | src/eval/dict.rs | 5 |
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 { |
