mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-10-28 23:35:02 -04:00
fix lifetime elision warnings
This commit is contained in:
parent
bc93712314
commit
dc1909d073
@ -30,7 +30,7 @@ impl<T> Mutex<T> {
|
|||||||
|
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn lock(&self) -> std::sync::MutexGuard<T> {
|
pub fn lock(&self) -> std::sync::MutexGuard<'_, T> {
|
||||||
self.0.lock().expect(NOT_POISONED)
|
self.0.lock().expect(NOT_POISONED)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,7 @@ impl Receiver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn as_future(&self) -> ReceiverRefFuture {
|
pub fn as_future(&self) -> ReceiverRefFuture<'_> {
|
||||||
ReceiverRefFuture {
|
ReceiverRefFuture {
|
||||||
receiver: self,
|
receiver: self,
|
||||||
waker_i: NO_WAKER,
|
waker_i: NO_WAKER,
|
||||||
|
|||||||
@ -55,7 +55,7 @@ fn fixed_len_num<'a, T: FromStr>(len: usize) -> impl FnMut(&'a str) -> IResult<'
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Parses `YYYY-mm-dd` into pieces.
|
/// Parses `YYYY-mm-dd` into pieces.
|
||||||
fn parse_datepart(input: &str) -> IResult<&str, (i16, i8, i8)> {
|
fn parse_datepart(input: &str) -> IResult<'_, &str, (i16, i8, i8)> {
|
||||||
tuple((
|
tuple((
|
||||||
fixed_len_num(4),
|
fixed_len_num(4),
|
||||||
preceded(tag("-"), fixed_len_num(2)),
|
preceded(tag("-"), fixed_len_num(2)),
|
||||||
@ -64,7 +64,7 @@ fn parse_datepart(input: &str) -> IResult<&str, (i16, i8, i8)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Parses `HH:MM[:SS[:FFFFF]]` into pieces.
|
/// Parses `HH:MM[:SS[:FFFFF]]` into pieces.
|
||||||
fn parse_timepart(input: &str) -> IResult<&str, (i8, i8, i8, i32)> {
|
fn parse_timepart(input: &str) -> IResult<'_, &str, (i8, i8, i8, i32)> {
|
||||||
let (input, (hr, _, min)) = tuple((fixed_len_num(2), tag(":"), fixed_len_num(2)))(input)?;
|
let (input, (hr, _, min)) = tuple((fixed_len_num(2), tag(":"), fixed_len_num(2)))(input)?;
|
||||||
let (input, stuff) = opt(tuple((
|
let (input, stuff) = opt(tuple((
|
||||||
preceded(tag(":"), fixed_len_num(2)),
|
preceded(tag(":"), fixed_len_num(2)),
|
||||||
@ -75,7 +75,7 @@ fn parse_timepart(input: &str) -> IResult<&str, (i8, i8, i8, i32)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Parses `Z` (UTC) or `{+,-,}HH:MM` into a time zone offset in seconds.
|
/// Parses `Z` (UTC) or `{+,-,}HH:MM` into a time zone offset in seconds.
|
||||||
fn parse_zone(input: &str) -> IResult<&str, i32> {
|
fn parse_zone(input: &str) -> IResult<'_, &str, i32> {
|
||||||
alt((
|
alt((
|
||||||
nom::combinator::value(0, tag("Z")),
|
nom::combinator::value(0, tag("Z")),
|
||||||
map(
|
map(
|
||||||
|
|||||||
@ -2417,7 +2417,7 @@ impl<C: Clocks + Clone> Database<C> {
|
|||||||
|
|
||||||
/// Locks the database; the returned reference is the only way to perform (read or write)
|
/// Locks the database; the returned reference is the only way to perform (read or write)
|
||||||
/// operations.
|
/// operations.
|
||||||
pub fn lock(&self) -> DatabaseGuard<C> {
|
pub fn lock(&self) -> DatabaseGuard<'_, C> {
|
||||||
let timer = clock::TimerGuard::new(&self.clocks, acquisition);
|
let timer = clock::TimerGuard::new(&self.clocks, acquisition);
|
||||||
let db = self.db.as_ref().unwrap().lock();
|
let db = self.db.as_ref().unwrap().lock();
|
||||||
drop(timer);
|
drop(timer);
|
||||||
|
|||||||
@ -81,12 +81,12 @@ impl Point {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator over state as of immediately before this point.
|
/// Returns an iterator over state as of immediately before this point.
|
||||||
fn prev(&self) -> PointDataIterator {
|
fn prev(&self) -> PointDataIterator<'_> {
|
||||||
PointDataIterator::new(&self.data[0..self.changes_off])
|
PointDataIterator::new(&self.data[0..self.changes_off])
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator over changes in this point.
|
/// Returns an iterator over changes in this point.
|
||||||
fn changes(&self) -> PointDataIterator {
|
fn changes(&self) -> PointDataIterator<'_> {
|
||||||
PointDataIterator::new(&self.data[self.changes_off..])
|
PointDataIterator::new(&self.data[self.changes_off..])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ fn default_pixel_aspect_ratio(width: u16, height: u16) -> (u16, u16) {
|
|||||||
(1, 1)
|
(1, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse(data: &[u8]) -> Result<AvcDecoderConfigurationRecord, Error> {
|
fn parse(data: &[u8]) -> Result<AvcDecoderConfigurationRecord<'_>, Error> {
|
||||||
if data.len() < 94 || &data[4..8] != b"avc1" || &data[90..94] != b"avcC" {
|
if data.len() < 94 || &data[4..8] != b"avc1" || &data[90..94] != b"avcC" {
|
||||||
bail!(
|
bail!(
|
||||||
DataLoss,
|
DataLoss,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user