mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-12-03 14:31:25 -05:00
clippy
This commit is contained in:
@@ -345,7 +345,7 @@ fn compare_stream(
|
||||
stream
|
||||
.recordings
|
||||
.entry(id.recording())
|
||||
.or_insert_with(Recording::default)
|
||||
.or_default()
|
||||
.recording_row = Some(s);
|
||||
}
|
||||
}
|
||||
@@ -382,7 +382,7 @@ fn compare_stream(
|
||||
stream
|
||||
.recordings
|
||||
.entry(id.recording())
|
||||
.or_insert_with(Recording::default)
|
||||
.or_default()
|
||||
.playback_row = Some(s);
|
||||
}
|
||||
}
|
||||
@@ -405,7 +405,7 @@ fn compare_stream(
|
||||
stream
|
||||
.recordings
|
||||
.entry(id.recording())
|
||||
.or_insert_with(Recording::default)
|
||||
.or_default()
|
||||
.integrity_row = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ impl Value for SignalValue {
|
||||
type Change = SignalChange;
|
||||
|
||||
fn apply(&mut self, c: &SignalChange) {
|
||||
if self.states.len() < usize::try_from(c.new_state).unwrap() {
|
||||
if self.states.len() < usize::from(c.new_state) {
|
||||
self.states.resize(c.new_state as usize, 0);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ impl Value for SignalValue {
|
||||
|
||||
if c.old_state > 0 {
|
||||
// remove from old state.
|
||||
let i = usize::try_from(c.old_state).unwrap() - 1;
|
||||
let i = usize::from(c.old_state) - 1;
|
||||
assert!(
|
||||
self.states.len() > i,
|
||||
"no such old state: s={self:?} c={c:?}"
|
||||
|
||||
Reference in New Issue
Block a user