summaryrefslogtreecommitdiff
path: root/src/eval/dict.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-03-15 15:27:36 +0100
committerLaurenz <laurmaedje@gmail.com>2022-03-15 15:27:36 +0100
commit77d153d315a2a5909840ebcd47491e4cef14428b (patch)
tree0886afd2ac4b03facb7c33a4e59924e30f55fd41 /src/eval/dict.rs
parentae0a56cdffa515ed6bb7cb566c025cc66ff00f33 (diff)
Add `in` and `not in` operators
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 03871fa0..9127b2eb 100644
--- a/src/eval/dict.rs
+++ b/src/eval/dict.rs
@@ -61,6 +61,11 @@ impl Dict {
Arc::make_mut(&mut self.0).insert(key, value);
}
+ /// Whether the dictionary contains a specific key.
+ pub fn contains_key(&self, key: &str) -> bool {
+ self.0.contains_key(key)
+ }
+
/// Clear the dictionary.
pub fn clear(&mut self) {
if Arc::strong_count(&self.0) == 1 {