Skip to content

Commit 6851f06

Browse files
committed
chore: update cpal to latest Git, replace From<Input> for cpal::Device with into_inner
1 parent d89514d commit 6851f06

File tree

4 files changed

+131
-22
lines changed

4 files changed

+131
-22
lines changed

Cargo.lock

Lines changed: 125 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ all-features = true
103103
rustdoc-args = ["--cfg", "docsrs"]
104104

105105
[dependencies]
106-
cpal = { version = "0.16", optional = true }
106+
cpal = { git = "https://github.com/RustAudio/cpal", rev = "c9d8e2e18789e305e2d087d65888f06db08bd2ba", optional = true }
107107
dasp_sample = "0.11.0"
108108
claxon = { version = "0.4.2", optional = true }
109109
hound = { version = "3.5", optional = true }

examples/microphone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn main() -> Result<(), Box<dyn Error>> {
1313
.prompt()?;
1414

1515
let input = MicrophoneBuilder::new()
16-
.device(input)?
16+
.device(input.into_inner())?
1717
.default_config()?
1818
.open_stream()?;
1919

src/microphone.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ pub struct Input {
130130
inner: cpal::Device,
131131
}
132132

133-
impl From<Input> for cpal::Device {
134-
fn from(val: Input) -> Self {
135-
val.inner
133+
impl Input {
134+
/// Consumes the input and returns the inner device.
135+
pub fn into_inner(self) -> cpal::Device {
136+
self.inner
136137
}
137138
}
138139

0 commit comments

Comments
 (0)