From 5b8e10394d31f4975ec5402edf21fea28c62bc0d Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Fri, 1 Jan 2021 11:07:24 -0800 Subject: [PATCH] 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. --- lib/src/transaction.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/transaction.rs b/lib/src/transaction.rs index 2bee205d4..92ef75768 100644 --- a/lib/src/transaction.rs +++ b/lib/src/transaction.rs @@ -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."); } } }