Skip to content

Commit efc6da8

Browse files
committed
Add more methods
1 parent c715181 commit efc6da8

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/chunk.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl Chunk {
4949
}
5050
}
5151

52-
/// TODO
52+
/// Create a new chunk with the given write settings.
5353
pub fn new_with(write_settings: WriteSettings) -> Self {
5454
let mut chunk = Self::new();
5555
chunk.write_settings = write_settings;
@@ -64,6 +64,11 @@ impl Chunk {
6464
self.buf.len()
6565
}
6666

67+
/// Reserve an additional number of bytes in the buffer.
68+
pub fn reserve(&mut self, additional: usize) {
69+
self.buf.reserve(additional);
70+
}
71+
6772
/// The bytes already written so far.
6873
pub fn as_bytes(&self) -> &[u8] {
6974
self.buf.as_slice()

src/content.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl Content {
1818
Self::with_capacity(1024)
1919
}
2020

21-
/// TODO
21+
/// Create a new content stream with the given write settings.
2222
pub fn new_with(write_settings: WriteSettings) -> Self {
2323
let mut content = Self::new();
2424
content.write_settings = write_settings;

0 commit comments

Comments
 (0)