mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-12-06 07:42:29 -05:00
cargo clippy --fix
This switches to inlining variable names into format args. clippy now suggests this syntax, and I like it.
This commit is contained in:
@@ -106,7 +106,7 @@ impl Value for SignalValue {
|
||||
let s = &mut self.states[c.new_state as usize - 1];
|
||||
let n = s
|
||||
.checked_add(u64::try_from(c.duration.0).unwrap())
|
||||
.unwrap_or_else(|| panic!("add range violation: s={:?} c={:?}", s, c));
|
||||
.unwrap_or_else(|| panic!("add range violation: s={s:?} c={c:?}"));
|
||||
*s = n;
|
||||
}
|
||||
|
||||
@@ -115,14 +115,12 @@ impl Value for SignalValue {
|
||||
let i = usize::try_from(c.old_state).unwrap() - 1;
|
||||
assert!(
|
||||
self.states.len() > i,
|
||||
"no such old state: s={:?} c={:?}",
|
||||
self,
|
||||
c
|
||||
"no such old state: s={self:?} c={c:?}"
|
||||
);
|
||||
let s = &mut self.states[c.old_state as usize - 1];
|
||||
let n = s
|
||||
.checked_sub(u64::try_from(c.duration.0).unwrap())
|
||||
.unwrap_or_else(|| panic!("sub range violation: s={:?} c={:?}", s, c));
|
||||
.unwrap_or_else(|| panic!("sub range violation: s={s:?} c={c:?}"));
|
||||
*s = n;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user