refactor(audio_player): remove unwrap in ensure_stream (#107)

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
Tarasov Aleksandr
2026-05-16 08:59:54 +03:00
committed by GitHub
parent 5f69345d45
commit 5ae82ef28c
+3 -1
View File
@@ -95,7 +95,9 @@ impl AudioPlayer {
sink.log_on_drop(false); sink.log_on_drop(false);
self.stream_handle = Some(sink); self.stream_handle = Some(sink);
} }
Ok(self.stream_handle.as_ref().unwrap()) self.stream_handle
.as_ref()
.ok_or_else(|| anyhow!("Failed to initialize stream_handle"))
} }
fn drop_stream(&mut self) { fn drop_stream(&mut self) {