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

This commit is contained in:
Alexandre Pasmantier 2025-01-09 20:38:24 +01:00
parent 510b528588
commit abbd9157d3

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;
}
} }
} }