Skip to content

Commit 7f86eca

Browse files
committed
intoiter: Add release method to OwnedRepr
1 parent 2c7c6e8 commit 7f86eca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/data_repr.rs

+7
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ impl<A> OwnedRepr<A> {
9292
self.len = new_len;
9393
}
9494

95+
/// Return the length (number of elements in total)
96+
pub(crate) fn release_all_elements(&mut self) -> usize {
97+
let ret = self.len;
98+
self.len = 0;
99+
ret
100+
}
101+
95102
/// Cast self into equivalent repr of other element type
96103
///
97104
/// ## Safety

0 commit comments

Comments
 (0)