From 0df98cebc6007f9c927b79769ee27cd0ad6e54bb Mon Sep 17 00:00:00 2001 From: Ritchie Vink Date: Thu, 2 Dec 2021 09:54:58 +0100 Subject: [PATCH] add documentation to Bitmap::as_slice --- src/bitmap/immutable.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bitmap/immutable.rs b/src/bitmap/immutable.rs index 8a98c2caa97..3b21aac1dc8 100644 --- a/src/bitmap/immutable.rs +++ b/src/bitmap/immutable.rs @@ -238,6 +238,12 @@ impl Bitmap { impl Bitmap { /// Returns the byte slice of this Bitmap. + /// + /// The returned tuple contains: + /// .1 -> The byte slice, truncated to the start of the first bit. So the start of the slice + /// slice is within the first 8 bits. + /// .2 -> The start offset in bits, given what described above `0 <= offsets < 8`. + /// .3 -> The length in bits. #[inline] pub fn as_slice(&self) -> (&[u8], usize, usize) { let start = self.offset / 8;