summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Fitzgerald <fitzgen@gmail.com>2017-07-20 13:17:30 -0700
committerNick Fitzgerald <fitzgen@gmail.com>2017-07-20 15:34:34 -0700
commit291f623ae944c156702b2bfd514376c0a438fa91 (patch)
tree8513f3a533c81a40ad9ff310968ded3551075c63
parent497f0280e1f1f23dd61d26adfc6f083250f93fd3 (diff)
Fix variable name to reflect its semantics
Set insertion returns true if it was *not* already in the set. The assertion was already correct, but the name was backwards. Additionally, this removes a `format!` that is unnecessary.
-rw-r--r--src/ir/analysis/derive_debug.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ir/analysis/derive_debug.rs b/src/ir/analysis/derive_debug.rs
index 675317e9..4294a832 100644
--- a/src/ir/analysis/derive_debug.rs
+++ b/src/ir/analysis/derive_debug.rs
@@ -78,11 +78,12 @@ impl<'ctx, 'gen> CannotDeriveDebug<'ctx, 'gen> {
}
fn insert(&mut self, id: ItemId) -> bool {
- let was_already_in = self.cannot_derive_debug.insert(id);
+ let was_not_already_in_set = self.cannot_derive_debug.insert(id);
assert!(
- was_already_in,
- format!("We shouldn't try and insert twice because if it was already in the set, \
- `constrain` would have exited early.: {:?}", id)
+ was_not_already_in_set,
+ "We shouldn't try and insert {:?} twice because if it was \
+ already in the set, `constrain` should have exited early.",
+ id
);
true
}