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

@@ -335,7 +335,7 @@ impl MediaSource for ToAudioBytes {
#[inline]
fn write_out(
source: &AudioBufferRef,
source: &AudioBufferRef<'_>,
target: &mut [u8],
source_pos: &mut Range<usize>,
spillover: &mut Vec<f32>,

View File

@@ -133,7 +133,7 @@ impl Decoder for OpusDecoder {
FinalizeResult::default()
}
fn last_decoded(&self) -> AudioBufferRef {
fn last_decoded(&self) -> AudioBufferRef<'_> {
self.buf.as_audio_buffer_ref()
}
}

View File

@@ -136,7 +136,7 @@ impl LiveInput {
/// Tries to get any information about this audio stream acquired during parsing.
///
/// Only exists when this input is [`LiveInput::Parsed`].
pub fn metadata(&mut self) -> Result<Metadata, MetadataError> {
pub fn metadata(&mut self) -> Result<Metadata<'_>, MetadataError> {
if let Some(parsed) = self.parsed_mut() {
Ok(parsed.into())
} else {

View File

@@ -205,8 +205,7 @@ impl Input {
/// will always fail with [`AudioStreamError::Unsupported`].
pub async fn aux_metadata(&mut self) -> Result<AuxMetadata, AuxMetadataError> {
match self {
Self::Lazy(ref mut composer) => composer.aux_metadata().await.map_err(Into::into),
Self::Live(_, Some(ref mut composer)) =>
Self::Lazy(ref mut composer) | Self::Live(_, Some(ref mut composer)) =>
composer.aux_metadata().await.map_err(Into::into),
Self::Live(_, None) => Err(AuxMetadataError::NoCompose),
}
@@ -216,7 +215,7 @@ impl Input {
///
/// Only exists when this input is both [`Self::Live`] and has been fully parsed.
/// In general, you probably want to use [`Self::aux_metadata`].
pub fn metadata(&mut self) -> Result<Metadata, MetadataError> {
pub fn metadata(&mut self) -> Result<Metadata<'_>, MetadataError> {
if let Self::Live(live, _) = self {
live.metadata()
} else {