Skip to content

Commit d717a09

Browse files
author
dvdsk
committed
apply review feedback
1 parent f81266b commit d717a09

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

src/queue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ pub struct SourcesQueueInput {
5656
impl SourcesQueueInput {
5757
/// Adds a new source to the end of the queue.
5858
#[inline]
59-
pub fn append<T>(&self, source: T) -> usize
59+
pub fn append<T>(&self, source: T)
6060
where
6161
T: Source + Send + 'static,
6262
{
6363
let mut next_sounds = self.next_sounds
6464
.lock()
6565
.unwrap();
6666
next_sounds.push((Box::new(source) as Box<_>, None));
67-
next_sounds.len()
67+
next_sounds.len();
6868
}
6969

7070
/// Adds a new source to the end of the queue.

src/speakers.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@
8484
//! use rodio::speakers::{SpeakersBuilder, available_outputs};
8585
//!
8686
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
87-
//! // List all available input devices
88-
//! let inputs = available_outputs()?;
89-
//! for (i, input) in inputs.iter().enumerate() {
90-
//! println!("Input {}: {}", i, input);
87+
//! // List all available output devices
88+
//! let outputs = available_outputs()?;
89+
//! for (i, output) in outputs.iter().enumerate() {
90+
//! println!("output {}: {}", i, output);
9191
//! }
9292
//!
9393
//! // Use a specific device (e.g., the second one)
9494
//! let mic = SpeakersBuilder::new()
95-
//! .device(inputs[1].clone())?
95+
//! .device(outputs[1].clone())?
9696
//! .default_config()?
9797
//! .open_stream()?;
9898
//! # Ok(())
@@ -119,11 +119,11 @@ struct Speakers;
119119

120120
/// Error that can occur when we can not list the output devices
121121
#[derive(Debug, thiserror::Error, Clone)]
122-
#[error("Could not list input devices")]
122+
#[error("Could not list output devices")]
123123
pub struct ListError(#[source] cpal::DevicesError);
124124
assert_error_traits! {ListError}
125125

126-
/// An input device
126+
/// An output device
127127
#[derive(Clone)]
128128
pub struct Output {
129129
inner: cpal::Device,

src/speakers/builder.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ use crate::{
1111
ChannelCount, OutputStream, SampleRate,
1212
};
1313

14-
/// Error configuring or opening speakers input
14+
/// Error configuring or opening speakers output
1515
#[allow(missing_docs)]
1616
#[derive(Debug, thiserror::Error, Clone)]
1717
pub enum Error {
1818
/// No output device is available on the system.
19-
#[error("There is no input device")]
19+
#[error("There is no output device")]
2020
NoDevice,
2121
/// Failed to get the default output configuration for the device.
2222
#[error("Could not get default output configuration for output device: '{device_name}'")]
@@ -54,7 +54,7 @@ pub struct ConfigNotSet;
5454
/// Some methods are only available when this types counterpart: `DeviceIsSet` is present.
5555
pub struct DeviceNotSet;
5656

57-
/// Builder for configuring and opening speakers input streams.
57+
/// Builder for configuring and opening speakers output streams.
5858
#[must_use]
5959
pub struct SpeakersBuilder<Device, Config, E = fn(cpal::StreamError)>
6060
where
@@ -122,13 +122,13 @@ impl<Device, Config, E> SpeakersBuilder<Device, Config, E>
122122
where
123123
E: FnMut(cpal::StreamError) + Send + Clone + 'static,
124124
{
125-
/// Sets the input device to use.
125+
/// Sets the output device to use.
126126
///
127127
/// # Example
128128
/// ```no_run
129129
/// # use rodio::speakers::{SpeakersBuilder, available_outputs};
130-
/// let input = available_outputs()?.remove(2);
131-
/// let builder = SpeakersBuilder::new().device(input)?;
130+
/// let output = available_outputs()?.remove(2);
131+
/// let builder = SpeakersBuilder::new().device(output)?;
132132
/// # Ok::<(), Box<dyn std::error::Error>>(())
133133
/// ```
134134
pub fn device(
@@ -152,7 +152,7 @@ where
152152
})
153153
}
154154

155-
/// Uses the system's default input device.
155+
/// Uses the system's default output device.
156156
///
157157
/// # Example
158158
/// ```no_run
@@ -187,7 +187,7 @@ impl<Config, E> SpeakersBuilder<DeviceIsSet, Config, E>
187187
where
188188
E: FnMut(cpal::StreamError) + Send + Clone + 'static,
189189
{
190-
/// Uses the device's default input configuration.
190+
/// Uses the device's default output configuration.
191191
///
192192
/// # Example
193193
/// ```no_run
@@ -227,7 +227,7 @@ where
227227
})
228228
}
229229

230-
/// Sets a custom input configuration.
230+
/// Sets a custom output configuration.
231231
///
232232
/// # Example
233233
/// ```no_run
@@ -278,7 +278,7 @@ impl<E> SpeakersBuilder<DeviceIsSet, ConfigIsSet, E>
278278
where
279279
E: FnMut(cpal::StreamError) + Send + Clone + 'static,
280280
{
281-
/// Sets the sample rate for input.
281+
/// Sets the sample rate for output.
282282
///
283283
/// # Error
284284
/// Returns an error if the requested sample rate combined with the
@@ -361,7 +361,7 @@ where
361361
}
362362
}
363363

364-
/// Sets the number of input channels.
364+
/// Sets the number of output channels.
365365
///
366366
/// # Example
367367
/// ```no_run
@@ -417,13 +417,13 @@ where
417417
})
418418
}
419419

420-
/// Sets the buffer size for the input.
420+
/// Sets the buffer size for the output.
421421
///
422422
/// This has no impact on latency, though a too small buffer can lead to audio
423423
/// artifacts if your program can not get samples out of the buffer before they
424424
/// get overridden again.
425425
///
426-
/// Normally the default input config will have this set up correctly.
426+
/// Normally the default output config will have this set up correctly.
427427
///
428428
/// # Example
429429
/// ```no_run
@@ -504,7 +504,7 @@ impl<Device, E> SpeakersBuilder<Device, ConfigIsSet, E>
504504
where
505505
E: FnMut(cpal::StreamError) + Send + Clone + 'static,
506506
{
507-
/// Returns the current input configuration.
507+
/// Returns the current output configuration.
508508
///
509509
/// # Example
510510
/// ```no_run
@@ -526,7 +526,7 @@ impl<E> SpeakersBuilder<DeviceIsSet, ConfigIsSet, E>
526526
where
527527
E: FnMut(cpal::StreamError) + Send + Clone + 'static,
528528
{
529-
/// Opens the speakers input stream.
529+
/// Opens the speakers output stream.
530530
///
531531
/// # Example
532532
/// ```no_run

0 commit comments

Comments
 (0)