From 9c85eecb598716f4f6261dbd0fb4fe30ed5bbaa8 Mon Sep 17 00:00:00 2001 From: JoshuaBatty Date: Wed, 27 May 2020 12:15:31 +0200 Subject: [PATCH] cargo fmt fix --- asio-sys/src/bindings/mod.rs | 32 ++++++++++++++++++-------------- examples/beep.rs | 2 +- examples/feedback.rs | 2 +- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/asio-sys/src/bindings/mod.rs b/asio-sys/src/bindings/mod.rs index 6f54980..36b2dee 100644 --- a/asio-sys/src/bindings/mod.rs +++ b/asio-sys/src/bindings/mod.rs @@ -386,11 +386,11 @@ impl Driver { } /// Get the min and max supported buffersize of the driver. - pub fn buffersize_range(&self) -> Result<(c_long, c_long), AsioError> { - let buffer_sizes = asio_get_buffer_sizes()?; - let min = buffer_sizes.min; - let max = buffer_sizes.max; - Ok((min, max)) + pub fn buffersize_range(&self) -> Result<(c_long, c_long), AsioError> { + let buffer_sizes = asio_get_buffer_sizes()?; + let min = buffer_sizes.min; + let max = buffer_sizes.max; + Ok((min, max)) } /// Get current sample rate of the driver. @@ -442,7 +442,11 @@ impl Driver { /// If buffersize is None then the preferred buffer size from ASIO is used, /// otherwise the desired buffersize is used if the requeted size is within /// the range of accepted buffersizes for the device. - fn create_buffers(&self, buffer_infos: &mut [AsioBufferInfo], buffer_size: Option) -> Result { + fn create_buffers( + &self, + buffer_infos: &mut [AsioBufferInfo], + buffer_size: Option, + ) -> Result { let num_channels = buffer_infos.len(); // To pass as ai::ASIOCallbacks @@ -464,9 +468,9 @@ impl Driver { if v <= buffer_sizes.max { v } else { - return Err(AsioError::InvalidBufferSize) + return Err(AsioError::InvalidBufferSize); } - }, + } None => buffer_sizes.pref, }; @@ -492,9 +496,9 @@ impl Driver { /// Creates the streams. /// - /// `buffer_size` sets the desired buffer_size. If None is passed in, then the + /// `buffer_size` sets the desired buffer_size. If None is passed in, then the /// default buffersize for the device is used. - /// + /// /// Both input and output streams need to be created together as a single slice of /// `ASIOBufferInfo`. fn create_streams( @@ -561,8 +565,8 @@ impl Driver { /// For this reason we take the output stream if it exists. /// /// `num_channels` is the desired number of input channels. - /// - /// `buffer_size` sets the desired buffer_size. If None is passed in, then the + /// + /// `buffer_size` sets the desired buffer_size. If None is passed in, then the /// default buffersize for the device is used. /// /// This returns a full AsioStreams with both input and output if output was active. @@ -588,9 +592,9 @@ impl Driver { /// /// `num_channels` is the desired number of output channels. /// - /// `buffer_size` sets the desired buffer_size. If None is passed in, then the + /// `buffer_size` sets the desired buffer_size. If None is passed in, then the /// default buffersize for the device is used. - /// + /// /// This returns a full AsioStreams with both input and output if input was active. pub fn prepare_output_stream( &self, diff --git a/examples/beep.rs b/examples/beep.rs index 6da7284..dec1fdf 100644 --- a/examples/beep.rs +++ b/examples/beep.rs @@ -59,4 +59,4 @@ where *sample = value; } } -} \ No newline at end of file +} diff --git a/examples/feedback.rs b/examples/feedback.rs index 1530243..e44f2d0 100644 --- a/examples/feedback.rs +++ b/examples/feedback.rs @@ -105,4 +105,4 @@ fn main() -> Result<(), anyhow::Error> { fn err_fn(err: cpal::StreamError) { eprintln!("an error occurred on stream: {}", err); -} \ No newline at end of file +}