Fix clippy warnings (#214)
* Fix clippy warnings * Fix implicitly elided lifetimes
This commit is contained in:
@@ -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>,
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user