Skip to content

Commit faf420e

Browse files
cmooglaurmaedje
authored andcommitted
Add Chunk::as_bytes (#28)
1 parent a9062d8 commit faf420e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/chunk.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ impl Chunk {
3434
self.buf.len()
3535
}
3636

37+
/// The bytes already written so far.
38+
pub fn as_bytes(&self) -> &[u8] {
39+
self.buf.as_slice()
40+
}
41+
3742
/// Add all objects from another chunk to this one.
3843
pub fn extend(&mut self, other: &Chunk) {
3944
let base = self.len();

0 commit comments

Comments
 (0)