Remove expect
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
parent
8add08e51b
commit
dd8e6bfe16
1 changed files with 10 additions and 2 deletions
|
|
@ -171,9 +171,17 @@ impl Device {
|
||||||
|
|
||||||
fn default_input_config(&self) -> Result<SupportedStreamConfig, DefaultStreamConfigError> {
|
fn default_input_config(&self) -> Result<SupportedStreamConfig, DefaultStreamConfigError> {
|
||||||
let config = Self::supported_input_configs(self)
|
let config = Self::supported_input_configs(self)
|
||||||
.expect("failed to get supported input configs")
|
.map_err(|e| DefaultStreamConfigError::BackendSpecific {
|
||||||
|
err: BackendSpecificError {
|
||||||
|
description: format!("Failed to get supported input configs: {e}"),
|
||||||
|
},
|
||||||
|
})?
|
||||||
.next()
|
.next()
|
||||||
.expect("no supported input configs")
|
.ok_or(DefaultStreamConfigError::BackendSpecific {
|
||||||
|
err: BackendSpecificError {
|
||||||
|
description: "No supported input configs".to_string(),
|
||||||
|
},
|
||||||
|
})?
|
||||||
.with_max_sample_rate();
|
.with_max_sample_rate();
|
||||||
Ok(config)
|
Ok(config)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue