Skip to content

Commit 034202f

Browse files
committed
refactor: add debug assertion to ensure_capacity()
1 parent 262b84d commit 034202f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/imap_stream.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ impl Buffer {
181181

182182
// Assert that the buffer at least one free byte.
183183
debug_assert!(self.offset < self.block.len());
184+
185+
// Assert that the buffer has at least the required capacity.
186+
debug_assert!(self.block.len() >= required);
184187
Ok(())
185188
}
186189

0 commit comments

Comments
 (0)