fix(cable): filter out non-utf8 lines when loading cable candidates (#263)

Fixes #262
This commit is contained in:
Alex Pasmantier 2025-01-09 20:41:11 +01:00 committed by GitHub
parent 510b528588
commit 9433fea80d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -117,13 +117,15 @@ async fn load_candidates(command: String, injector: Injector<String>) {
let reader = BufReader::new(out); let reader = BufReader::new(out);
let mut produced_output = false; let mut produced_output = false;
#[allow(clippy::manual_flatten)]
for line in reader.lines() { for line in reader.lines() {
let line = line.unwrap(); if let Ok(l) = line {
if !line.trim().is_empty() { if !l.trim().is_empty() {
let () = injector.push(line, |e, cols| { let () = injector.push(l, |e, cols| {
cols[0] = e.clone().into(); cols[0] = e.clone().into();
}); });
produced_output = true; produced_output = true;
}
} }
} }