summaryrefslogtreecommitdiff
path: root/src/model/array.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-11-03 11:44:53 +0100
committerLaurenz <laurmaedje@gmail.com>2022-11-03 13:35:39 +0100
commit37a7afddfaffd44cb9bc013c9506599267e08983 (patch)
tree20e7d62d3c5418baff01a21d0406b91bf3096214 /src/model/array.rs
parent56342bd972a13ffe21beaf2b87ab7eb1597704b4 (diff)
Split crates
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.