Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
feat!: make len/len_proxy consistent with Offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Mar 15, 2023
1 parent db87f71 commit bc67c33
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/offset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,18 @@ impl<O: Offset> OffsetsBuffer<O> {
&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] {
Expand Down

0 comments on commit bc67c33

Please sign in to comment.