diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-03-15 15:27:36 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-03-15 15:27:36 +0100 |
| commit | 77d153d315a2a5909840ebcd47491e4cef14428b (patch) | |
| tree | 0886afd2ac4b03facb7c33a4e59924e30f55fd41 /src/eval/array.rs | |
| parent | ae0a56cdffa515ed6bb7cb566c025cc66ff00f33 (diff) | |
Add `in` and `not in` operators
Diffstat (limited to 'src/eval/array.rs')
| -rw-r--r-- | src/eval/array.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/eval/array.rs b/src/eval/array.rs index 5cd8df82..2da1a5f4 100644 --- a/src/eval/array.rs +++ b/src/eval/array.rs @@ -66,6 +66,11 @@ impl Array { Arc::make_mut(&mut self.0).push(value); } + /// Whether the array contains a specific value. + pub fn contains(&self, value: &Value) -> bool { + self.0.contains(value) + } + /// Clear the array. pub fn clear(&mut self) { if Arc::strong_count(&self.0) == 1 { |
