mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-07 13:32:57 +00:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user