mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-01-27 14:43:19 -05:00
stop using deprecated try!
This commit is contained in:
parent
e8a00d4639
commit
2ab7dbc9fb
@ -495,6 +495,7 @@ impl Segment {
|
|||||||
}
|
}
|
||||||
let mut have_frame = true;
|
let mut have_frame = true;
|
||||||
let mut key_frame = 0;
|
let mut key_frame = 0;
|
||||||
|
|
||||||
for i in 0 .. self.frames {
|
for i in 0 .. self.frames {
|
||||||
if !have_frame {
|
if !have_frame {
|
||||||
bail!("recording {}: expected {} frames, found only {}", self.id, self.frames, i+1);
|
bail!("recording {}: expected {} frames, found only {}", self.id, self.frames, i+1);
|
||||||
@ -507,11 +508,16 @@ impl Segment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: this inner loop uses try! rather than ? for performance. Don't change these
|
// Note: this inner loop avoids ? for performance. Don't change these lines without
|
||||||
// lines without reading https://github.com/rust-lang/rust/issues/37939 and running
|
// reading https://github.com/rust-lang/rust/issues/37939 and running
|
||||||
// mp4::bench::build_index.
|
// mp4::bench::build_index.
|
||||||
r#try!(f(&it));
|
if let Err(e) = f(&it) {
|
||||||
have_frame = r#try!(it.next(data));
|
return Err(e);
|
||||||
|
}
|
||||||
|
have_frame = match it.next(data) {
|
||||||
|
Err(e) => return Err(e),
|
||||||
|
Ok(hf) => hf,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if key_frame < self.key_frames {
|
if key_frame < self.key_frames {
|
||||||
bail!("recording {}: expected {} key frames, found only {}",
|
bail!("recording {}: expected {} key frames, found only {}",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user