summaryrefslogtreecommitdiff
path: root/src/model/array.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/array.rs')
-rw-r--r--src/model/array.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/model/array.rs b/src/model/array.rs
index 196f02ec..053248ec 100644
--- a/src/model/array.rs
+++ b/src/model/array.rs
@@ -9,8 +9,9 @@ use crate::syntax::Spanned;
use crate::util::ArcExt;
/// Create a new [`Array`] from values.
-#[allow(unused_macros)]
-macro_rules! array {
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __array {
($value:expr; $count:expr) => {
$crate::model::Array::from_vec(vec![$value.into(); $count])
};
@@ -20,6 +21,9 @@ macro_rules! array {
};
}
+#[doc(inline)]
+pub use crate::__array as array;
+
/// A reference counted array with value semantics.
#[derive(Default, Clone, PartialEq, Hash)]
pub struct Array(Arc<Vec<Value>>);
@@ -97,7 +101,7 @@ impl Array {
.ok_or_else(|| out_of_bounds(index, len))?;
Arc::make_mut(&mut self.0).remove(i);
- return Ok(());
+ Ok(())
}
/// Extract a contigous subregion of the array.