summaryrefslogtreecommitdiff
path: root/src/eval/array.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval/array.rs')
-rw-r--r--src/eval/array.rs5
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 {