Skip to content

Commit d6457c3

Browse files
committed
Guard against data loss
Signed-off-by: Moritz Hoffmann <[email protected]>
1 parent 02d99b5 commit d6457c3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

timely/examples/columnar.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,10 @@ mod builder {
335335

336336
#[inline]
337337
fn relax(&mut self) {
338+
/// The caller is responsible for draining all contents; assert that we are empty.
339+
/// The assertion is not strictly necessary, but it helps catch bugs.
340+
debug_assert!(self.current.is_empty());
341+
debug_assert!(self.pending.is_empty());
338342
*self = Self::default();
339343
}
340344
}

0 commit comments

Comments
 (0)