Fix clippy errors on nightly (2021-09-29) (#691)

Most of the changes are for the new if-then-panic lint added in
https://github.com/rust-lang/rust-clippy/pull/7669.
This commit is contained in:
Max Sharnoff
2021-10-01 15:45:42 -07:00
committed by GitHub
parent 7095a5d551
commit 84f7dcd052
6 changed files with 26 additions and 32 deletions

View File

@@ -192,9 +192,7 @@ impl AtomicLsn {
/// This operation will panic on overflow.
pub fn fetch_add(&self, val: u64) -> Lsn {
let prev = self.inner.fetch_add(val, Ordering::AcqRel);
if prev.checked_add(val).is_none() {
panic!("AtomicLsn overflow");
}
assert!(prev.checked_add(val).is_some(), "AtomicLsn overflow");
Lsn(prev)
}