diff --git a/Cargo.toml b/Cargo.toml index eee3d0a..4dd9fb8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "context-switch" -version = "1.1.0" +version = "1.1.1" edition = "2024" rust-version = "1.88" diff --git a/audio-knife/Cargo.toml b/audio-knife/Cargo.toml index 88f729c..01784d7 100644 --- a/audio-knife/Cargo.toml +++ b/audio-knife/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "audio-knife" -version = "1.4.0" +version = "1.4.1" edition = "2024" [profile.dev] diff --git a/audio-knife/src/app_error.rs b/audio-knife/src/app_error.rs index d60bebb..6814243 100644 --- a/audio-knife/src/app_error.rs +++ b/audio-knife/src/app_error.rs @@ -5,6 +5,7 @@ use axum::{ response::{IntoResponse, Response}, }; +#[allow(unused)] pub struct AppError(anyhow::Error); // Tell axum how to convert `AppError` into a response. diff --git a/external/azure-speech-sdk-rs b/external/azure-speech-sdk-rs index d22b0fa..62bd6b1 160000 --- a/external/azure-speech-sdk-rs +++ b/external/azure-speech-sdk-rs @@ -1 +1 @@ -Subproject commit d22b0fac8e4db0b4586d5ec0e2d465005fed4dd9 +Subproject commit 62bd6b118db397f165dc96997867ac9b475d42c5 diff --git a/services/azure/src/translate.rs b/services/azure/src/translate.rs index dc238e0..80a098e 100644 --- a/services/azure/src/translate.rs +++ b/services/azure/src/translate.rs @@ -41,12 +41,12 @@ impl Service for AzureTranslate { sample_rate: 16000, }; - if let Some(audio_format) = output_modalities.audio { - if audio_format != AUDIO_OUTPUT_FORMAT { - bail!( - "Only {AUDIO_OUTPUT_FORMAT:?} is supported, but output modalities contains {audio_format:?}" - ); - } + if let Some(audio_format) = output_modalities.audio + && audio_format != AUDIO_OUTPUT_FORMAT + { + bail!( + "Only {AUDIO_OUTPUT_FORMAT:?} is supported, but output modalities contains {audio_format:?}" + ); } // Host / Auth is lightweight, so we can create this every time. diff --git a/services/playback/src/stream_reader.rs b/services/playback/src/stream_reader.rs index b5db64a..3d885c8 100644 --- a/services/playback/src/stream_reader.rs +++ b/services/playback/src/stream_reader.rs @@ -31,17 +31,16 @@ impl io::Read for StreamReader { } // If we have a current chunk with remaining data, use it - if let Some(ref chunk) = self.current_chunk { - if self.chunk_offset < chunk.len() { - let remaining_in_chunk = chunk.len() - self.chunk_offset; - let to_copy = std::cmp::min(buf.len(), remaining_in_chunk); + if let Some(ref chunk) = self.current_chunk + && self.chunk_offset < chunk.len() + { + let remaining_in_chunk = chunk.len() - self.chunk_offset; + let to_copy = std::cmp::min(buf.len(), remaining_in_chunk); - buf[..to_copy] - .copy_from_slice(&chunk[self.chunk_offset..self.chunk_offset + to_copy]); - self.chunk_offset += to_copy; + buf[..to_copy].copy_from_slice(&chunk[self.chunk_offset..self.chunk_offset + to_copy]); + self.chunk_offset += to_copy; - return Ok(to_copy); - } + return Ok(to_copy); } // Need to get the next chunk from the stream