automated clippy fixes

This commit is contained in:
Scott Lamb 2025-01-22 09:40:25 -08:00
parent 865328f02d
commit c46832369a
6 changed files with 9 additions and 15 deletions

View File

@ -139,7 +139,7 @@ fn poll_impl(inner: &Inner, waker_i: &mut usize, cx: &mut Context<'_>) -> Poll<(
Poll::Pending
}
impl<'receiver> Future for ReceiverRefFuture<'receiver> {
impl Future for ReceiverRefFuture<'_> {
type Output = ();
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {

View File

@ -2444,7 +2444,7 @@ pub struct DatabaseGuard<'db, C: Clocks> {
_timer: clock::TimerGuard<'db, C, &'static str, fn() -> &'static str>,
}
impl<'db, C: Clocks + Clone> DatabaseGuard<'db, C> {
impl<C: Clocks + Clone> DatabaseGuard<'_, C> {
/// Tries to flush unwritten changes from the stream directories.
///
/// * commits any recordings added with `add_recording` that have since been marked as
@ -2459,14 +2459,14 @@ impl<'db, C: Clocks + Clone> DatabaseGuard<'db, C> {
}
}
impl<'db, C: Clocks + Clone> ::std::ops::Deref for DatabaseGuard<'db, C> {
impl<C: Clocks + Clone> ::std::ops::Deref for DatabaseGuard<'_, C> {
type Target = LockedDatabase;
fn deref(&self) -> &LockedDatabase {
&self.db
}
}
impl<'db, C: Clocks + Clone> ::std::ops::DerefMut for DatabaseGuard<'db, C> {
impl<C: Clocks + Clone> ::std::ops::DerefMut for DatabaseGuard<'_, C> {
fn deref_mut(&mut self) -> &mut LockedDatabase {
&mut self.db
}

View File

@ -395,10 +395,7 @@ impl Segment {
if let Err(e) = f(&it) {
return Err(e);
}
have_frame = match it.next(data) {
Err(e) => return Err(e),
Ok(hf) => hf,
};
have_frame = it.next(data)?;
}
if key_frame < self.key_frames {
bail!(

View File

@ -985,7 +985,7 @@ impl<F: FileWriter> InnerWriter<F> {
}
}
impl<'a, C: Clocks + Clone, D: DirWriter> Drop for Writer<'a, C, D> {
impl<C: Clocks + Clone, D: DirWriter> Drop for Writer<'_, C, D> {
fn drop(&mut self) {
if ::std::thread::panicking() {
// This will probably panic again. Don't do it.

View File

@ -376,7 +376,7 @@ struct SignalDayValue<'a> {
pub states: &'a [u64],
}
impl<'a> TopLevel<'a> {
impl TopLevel<'_> {
/// Serializes cameras as a list (rather than a map), optionally including the `days` and
/// `cameras` fields.
fn serialize_cameras<S>(
@ -440,7 +440,7 @@ pub struct ListRecordings<'a> {
pub video_sample_entries: (&'a db::LockedDatabase, Vec<i32>),
}
impl<'a> ListRecordings<'a> {
impl ListRecordings<'_> {
fn serialize_video_sample_entries<S>(
video_sample_entries: &(&db::LockedDatabase, Vec<i32>),
serializer: S,

View File

@ -129,10 +129,7 @@ impl<'a> StaticFileRequest<'a> {
p => (p, true),
};
let last_dot = match path.rfind('.') {
None => return None,
Some(d) => d,
};
let last_dot = path.rfind('.')?;
let ext = &path[last_dot + 1..];
let mime = match ext {
"css" => "text/css",