From bc67c336ef76b4a6838b25f358a1dd4c49afe61d Mon Sep 17 00:00:00 2001 From: Ritchie Vink Date: Wed, 15 Mar 2023 13:22:04 +0100 Subject: [PATCH] feat!: make `len/len_proxy` consistent with `Offsets` --- src/offset.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/offset.rs b/src/offset.rs index 4ab062ef6da..aac7621584f 100644 --- a/src/offset.rs +++ b/src/offset.rs @@ -377,12 +377,18 @@ impl OffsetsBuffer { &self.0 } - /// Returns the length of this container + /// Returns the length an array with these offsets would be. #[inline] - pub fn len(&self) -> usize { + pub fn len_proxy(&self) -> usize { self.0.len() - 1 } + #[inline] + /// Returns the number of offsets in this container. + pub fn len(&self) -> usize { + self.0.len() + } + /// Returns the byte slice stored in this buffer #[inline] pub fn as_slice(&self) -> &[O] {