Fix clippy warnings (#214)

* Fix clippy warnings

* Fix implicitly elided lifetimes
This commit is contained in:
Gnome!
2024-01-03 16:45:23 +00:00
committed by GitHub
parent d681b71b1f
commit 1b98c30746
15 changed files with 36 additions and 40 deletions

View File

@@ -28,7 +28,7 @@ pub enum TrackCommand {
/// Register an event on this track.
AddEvent(EventData),
/// Run some closure on this track, with direct access to the core object.
Do(Box<dyn FnOnce(View) -> Option<Action> + Send + Sync + 'static>),
Do(Box<dyn FnOnce(View<'_>) -> Option<Action> + Send + Sync + 'static>),
/// Request a copy of this track's state.
Request(Sender<TrackState>),
/// Change the loop count/strategy of this track.

View File

@@ -150,7 +150,7 @@ impl TrackHandle {
/// [`Metadata`]: crate::input::Metadata
pub fn action<F>(&self, action: F) -> TrackResult<()>
where
F: FnOnce(View) -> Option<Action> + Send + Sync + 'static,
F: FnOnce(View<'_>) -> Option<Action> + Send + Sync + 'static,
{
self.send(TrackCommand::Do(Box::new(action)))
}

View File

@@ -193,8 +193,8 @@ impl TrackQueue {
pub(crate) async fn get_preload_time(track: &mut Track) -> Option<Duration> {
let meta = match track.input {
Input::Lazy(ref mut rec) => rec.aux_metadata().await.ok(),
Input::Live(_, Some(ref mut rec)) => rec.aux_metadata().await.ok(),
Input::Lazy(ref mut rec) | Input::Live(_, Some(ref mut rec)) =>
rec.aux_metadata().await.ok(),
Input::Live(_, None) => None,
};