transaction: add a message to check for unclosed transaction

I've forgotten to close a transaction a few times and while the
message ('assertion failed: self.closed') is clear to me now, it
probably won't be clear to others or to me in the future.
This commit is contained in:
Martin von Zweigbergk 2021-01-01 11:07:24 -08:00
parent 77bb8b600b
commit 5b8e10394d

View file

@ -195,7 +195,7 @@ impl<'r> Transaction<'r> {
impl<'r> Drop for Transaction<'r> {
fn drop(&mut self) {
if !std::thread::panicking() {
assert!(self.closed);
assert!(self.closed, "Transaction was dropped without being closed.");
}
}
}