Skip to content

Commit 31c30e5

Browse files
committed
return owned config
1 parent 290ce7d commit 31c30e5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/microphone/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ where
512512
/// println!("Channel count: {}", config.channel_count.get());
513513
/// # Ok::<(), Box<dyn std::error::Error>>(())
514514
/// ```
515-
pub fn get_config(&self) -> &InputConfig {
516-
self.config.as_ref().expect("ConfigIsSet")
515+
pub fn get_config(&self) -> InputConfig {
516+
self.config.copied().expect("ConfigIsSet")
517517
}
518518
}
519519

src/speakers/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ where
512512
/// println!("Channel count: {}", config.channel_count.get());
513513
/// # Ok::<(), Box<dyn std::error::Error>>(())
514514
/// ```
515-
pub fn get_config(&self) -> &OutputConfig {
516-
self.config.as_ref().expect("ConfigIsSet")
515+
pub fn get_config(&self) -> OutputConfig {
516+
self.config.copied().expect("ConfigIsSet")
517517
}
518518
}
519519

0 commit comments

Comments
 (0)