formats everything with cargo fmt

This commit is contained in:
dvdsk 2023-10-13 15:47:28 +02:00
parent 82bfa417ff
commit d1a809feac
No known key found for this signature in database
GPG key ID: 6CF9D20C5709A836
28 changed files with 32 additions and 88 deletions

View file

@ -88,11 +88,10 @@ where
#[inline]
fn try_seek(&mut self, _: Duration) -> Result<(), SeekError> {
Err(SeekError::NotSupported { underlying_source: std::any::type_name::<Self>() })
Err(SeekError::NotSupported {
underlying_source: std::any::type_name::<Self>(),
})
}
}
impl<S> Iterator for SamplesBuffer<S>

View file

@ -3,8 +3,8 @@ use std::io::{Read, Seek, SeekFrom};
use std::mem;
use std::time::Duration;
use crate::Source;
use crate::source::SeekError;
use crate::Source;
use claxon::FlacReader;
@ -83,7 +83,9 @@ where
#[inline]
fn try_seek(&mut self, _: Duration) -> Result<(), SeekError> {
Err(SeekError::NotSupported { underlying_source: std::any::type_name::<Self>() })
Err(SeekError::NotSupported {
underlying_source: std::any::type_name::<Self>(),
})
}
}

View file

@ -4,9 +4,9 @@ use std::time::Duration;
use crate::source::SeekError;
use crate::Source;
use minimp3_fixed as minimp3;
use minimp3::Frame;
use minimp3::Decoder;
use minimp3::Frame;
use minimp3_fixed as minimp3;
// use minimp3::{Decoder, SeekDecoder};
pub struct Mp3Decoder<R>
@ -29,9 +29,9 @@ where
}
// let mut decoder = SeekDecoder::new(data)
let mut decoder = Decoder::new(data);
// paramaters are correct and minimp3 is used correctly
// thus if we crash here one of these invariants is broken:
// .expect("should be able to allocate memory, perform IO");
// paramaters are correct and minimp3 is used correctly
// thus if we crash here one of these invariants is broken:
// .expect("should be able to allocate memory, perform IO");
// let current_frame = decoder.decode_frame()
let current_frame = decoder.next_frame()
// the reader makes enough data availible therefore
@ -97,7 +97,7 @@ where
fn next(&mut self) -> Option<i16> {
if self.current_frame_offset == self.current_frame_len().unwrap() {
if let Ok(frame) = self.decoder.next_frame() {
// if let Ok(frame) = self.decoder.decode_frame() {
// if let Ok(frame) = self.decoder.decode_frame() {
self.current_frame = frame;
self.current_frame_offset = 0;
} else {

View file

@ -109,7 +109,9 @@ where
#[inline]
fn try_seek(&mut self, _: Duration) -> Result<(), SeekError> {
Err(SeekError::NotSupported { underlying_source: std::any::type_name::<Self>() })
Err(SeekError::NotSupported {
underlying_source: std::any::type_name::<Self>(),
})
// uncomment when #510 is implemented (query position of playback)

View file

@ -100,7 +100,4 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.input.try_seek(pos)
}
}

View file

@ -154,9 +154,6 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.input.try_seek(pos)
}
}
#[derive(Clone, Debug)]

View file

@ -244,11 +244,10 @@ where
#[inline]
fn try_seek(&mut self, _: Duration) -> Result<(), SeekError> {
Err(SeekError::NotSupported { underlying_source: std::any::type_name::<Self>() })
Err(SeekError::NotSupported {
underlying_source: std::any::type_name::<Self>(),
})
}
}
impl<I> Clone for Buffered<I>

View file

@ -145,7 +145,4 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.input.try_seek(pos)
}
}

View file

@ -113,7 +113,4 @@ where
let pos_without_delay = pos.saturating_sub(self.requested_duration);
self.input.try_seek(pos_without_delay)
}
}

View file

@ -94,7 +94,4 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.input.try_seek(pos)
}
}

View file

@ -58,9 +58,8 @@ where
#[inline]
fn try_seek(&mut self, _: Duration) -> Result<(), SeekError> {
Err(SeekError::NotSupported { underlying_source: std::any::type_name::<Self>() })
Err(SeekError::NotSupported {
underlying_source: std::any::type_name::<Self>(),
})
}
}

View file

@ -57,9 +57,8 @@ where
#[inline]
fn try_seek(&mut self, _: Duration) -> Result<(), SeekError> {
Err(SeekError::NotSupported { underlying_source: std::any::type_name::<Self>() })
Err(SeekError::NotSupported {
underlying_source: std::any::type_name::<Self>(),
})
}
}

View file

@ -112,7 +112,4 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.input.try_seek(pos)
}
}

View file

@ -146,9 +146,6 @@ where
Ok(())
}
}
}
#[cfg(test)]

View file

@ -122,7 +122,4 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.input.try_seek(pos)
}
}

View file

@ -124,9 +124,6 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.input.try_seek(pos)
}
}
#[cfg(test)]

View file

@ -91,9 +91,6 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.inner.try_seek(pos)
}
}
impl<I> Clone for Repeat<I>

View file

@ -102,7 +102,4 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.inner.try_seek(pos)
}
}

View file

@ -60,12 +60,10 @@ impl Source for SineWave {
#[inline]
fn try_seek(&mut self, _: Duration) -> Result<(), SeekError> {
// This is a constant sound, normal seeking would not have any effect.
// While changing the phase of the sine wave could change how it sounds in
// combination with another sound (beating) such precision is not the intend
// This is a constant sound, normal seeking would not have any effect.
// While changing the phase of the sine wave could change how it sounds in
// combination with another sound (beating) such precision is not the intend
// of seeking
Ok(())
}
}

View file

@ -164,9 +164,6 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.input.try_seek(pos)
}
}
#[cfg(test)]

View file

@ -96,7 +96,4 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.input.try_seek(pos)
}
}

View file

@ -124,7 +124,4 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.input.try_seek(pos)
}
}

View file

@ -106,7 +106,4 @@ where
let pos_accounting_for_speedup = pos.mul_f32(self.factor);
self.input.try_seek(pos_accounting_for_speedup)
}
}

View file

@ -95,7 +95,4 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.input.try_seek(pos)
}
}

View file

@ -183,7 +183,4 @@ where
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
self.input.try_seek(pos)
}
}

View file

@ -84,7 +84,4 @@ where
fn try_seek(&mut self, _: Duration) -> Result<(), SeekError> {
Ok(())
}
}

View file

@ -4,7 +4,7 @@ use std::time::Duration;
use cpal::FromSample;
use crate::source::{Spatial, SeekError};
use crate::source::{SeekError, Spatial};
use crate::stream::{OutputStreamHandle, PlayError};
use crate::{Sample, Sink, Source};
@ -170,7 +170,7 @@ impl SpatialSink {
/// This blocks between 0 and ~5 milliseconds.
///
/// As long as the *duration of the source is known* seeking saturates. This means
/// when you try to seek beyong the length of the source this function will seek
/// when you try to seek beyong the length of the source this function will seek
/// to the end of the source instead.
///
/// If the duration of the source is known and the seek position lies beyond

View file

@ -30,7 +30,7 @@ fn sink_and_decoder(format: &str) -> (Sink, Decoder<impl Read + Seek>) {
(sink, decoder)
}
// run the following to get the other configuration:
// run the following to get the other configuration:
// cargo test --no-default-features
// --features symphonia-wav --features symphonia-vorbis
// --features symphonia-flac --features symphonia-isomp4 --features minimp3
@ -83,7 +83,7 @@ fn seek_beyond_end_saturates() {
println!("seeking beyond end for: {format}\t decoded by: {decoder_name}");
let res = sink.try_seek(Duration::from_secs(999));
assert!(dbg!(res).is_ok());
assert!(res.is_ok());
let now = Instant::now();
sink.sleep_until_end();