From ab76cf67374939ca42082486d5baae5da748732d Mon Sep 17 00:00:00 2001 From: boukeversteegh Date: Thu, 9 Apr 2026 00:39:35 +0200 Subject: [PATCH] Make Map and Array iteration methods public Change visibility of Map::keys(), Map::get(), Map::entries(), Map::len(), Array::iter(), and Array::len() from pub(crate) to pub, allowing downstream crates to inspect map/array contents without going through Sequence::serialize(). Co-Authored-By: Claude Opus 4.6 (1M context) --- xee-interpreter/src/function/array.rs | 4 ++-- xee-interpreter/src/function/map.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xee-interpreter/src/function/array.rs b/xee-interpreter/src/function/array.rs index b24ced48..75f6cca7 100644 --- a/xee-interpreter/src/function/array.rs +++ b/xee-interpreter/src/function/array.rs @@ -33,7 +33,7 @@ impl Array { self.0.get(index) } - pub(crate) fn iter(&self) -> impl DoubleEndedIterator { + pub fn iter(&self) -> impl DoubleEndedIterator { self.0.iter() } @@ -98,7 +98,7 @@ impl Array { Some(Self::new(vec)) } - pub(crate) fn len(&self) -> usize { + pub fn len(&self) -> usize { self.0.len() } diff --git a/xee-interpreter/src/function/map.rs b/xee-interpreter/src/function/map.rs index ca4ed51e..fea2043f 100644 --- a/xee-interpreter/src/function/map.rs +++ b/xee-interpreter/src/function/map.rs @@ -71,7 +71,7 @@ impl Map { Ok(Map::from_map(result)) } - pub(crate) fn len(&self) -> usize { + pub fn len(&self) -> usize { match self { Map::Empty(map) => map.len(), Map::One(map) => map.len(), @@ -85,21 +85,21 @@ impl Map { Map::Many(map) => map.is_empty(), } } - pub(crate) fn get(&self, key: &atomic::Atomic) -> Option<&sequence::Sequence> { + pub fn get(&self, key: &atomic::Atomic) -> Option<&sequence::Sequence> { match self { Map::Empty(map) => map.get(key), Map::One(map) => map.get(key), Map::Many(map) => map.get(key), } } - pub(crate) fn keys(&self) -> Box + '_> { + pub fn keys(&self) -> Box + '_> { match self { Map::Empty(map) => Box::new(map.keys()), Map::One(map) => Box::new(map.keys()), Map::Many(map) => Box::new(map.keys()), } } - pub(crate) fn entries( + pub fn entries( &self, ) -> Box + '_> { match self {