Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Replace flatten with map_while in stderr reader loop

Richie McIlroyc74e7e3126ea
diff --git a/apps/desktop/src-tauri/src/captions.rs b/apps/desktop/src-tauri/src/captions.rs
index 80a135e5b..0dde35418 100644
--- a/apps/desktop/src-tauri/src/captions.rs
+++ b/apps/desktop/src-tauri/src/captions.rs
@@ -1010,7 +1010,7 @@ fn start_whisperx_server(
std::thread::spawn(move || {
use std::io::BufRead;
let reader = std::io::BufReader::new(stderr);
- for line in reader.lines().flatten() {
+ for line in reader.lines().map_while(Result::ok) {
if let Some(stripped) = line.strip_prefix("STDERR:") {
log::info!("[WhisperX] {}", stripped);
} else {