mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 18:27:38 +00:00
debug: upgrade Drop
implementations to non-debug assert!
I think these remaining implementations of `Drop` are for types that are infrequently dropped (unlike `Transaction`), so it be fine to be more strict about them.
This commit is contained in:
parent
06bccb3387
commit
1f68de64d4
2 changed files with 2 additions and 2 deletions
|
@ -156,7 +156,7 @@ impl UnpublishedOperation {
|
||||||
impl Drop for UnpublishedOperation {
|
impl Drop for UnpublishedOperation {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if !std::thread::panicking() {
|
if !std::thread::panicking() {
|
||||||
debug_assert!(
|
assert!(
|
||||||
self.closed,
|
self.closed,
|
||||||
"UnpublishedOperation was dropped without being closed."
|
"UnpublishedOperation was dropped without being closed."
|
||||||
);
|
);
|
||||||
|
|
|
@ -912,7 +912,7 @@ impl LockedWorkingCopy<'_> {
|
||||||
impl Drop for LockedWorkingCopy<'_> {
|
impl Drop for LockedWorkingCopy<'_> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if !std::thread::panicking() {
|
if !std::thread::panicking() {
|
||||||
debug_assert!(
|
assert!(
|
||||||
self.closed,
|
self.closed,
|
||||||
"Working copy lock was dropped without being closed."
|
"Working copy lock was dropped without being closed."
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue