Skip to content

Commit

Permalink
intoiter: Add release method to OwnedRepr
Browse files Browse the repository at this point in the history
  • Loading branch information
bluss committed Apr 22, 2021
1 parent 2c7c6e8 commit 7f86eca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/data_repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ impl<A> OwnedRepr<A> {
self.len = new_len;
}

/// Return the length (number of elements in total)
pub(crate) fn release_all_elements(&mut self) -> usize {
let ret = self.len;
self.len = 0;
ret
}

/// Cast self into equivalent repr of other element type
///
/// ## Safety
Expand Down

0 comments on commit 7f86eca

Please sign in to comment.