From 5ae82ef28c703e9b7ade0a7a81b29f0cde277d85 Mon Sep 17 00:00:00 2001 From: Tarasov Aleksandr <55220741+arabianq@users.noreply.github.com> Date: Sat, 16 May 2026 08:59:54 +0300 Subject: [PATCH] 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> --- src/types/audio_player.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/types/audio_player.rs b/src/types/audio_player.rs index f3924f4..238cd7b 100644 --- a/src/types/audio_player.rs +++ b/src/types/audio_player.rs @@ -95,7 +95,9 @@ impl AudioPlayer { sink.log_on_drop(false); 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) {