feat(cable) keep data input order

This commit is contained in:
Osma S. Rautila 2025-01-06 19:52:41 +02:00
parent da2396e19a
commit feeed45aae
2 changed files with 3 additions and 2 deletions

View File

@ -29,6 +29,7 @@ strum = { version = "0.26.3", features = ["derive"] }
lazy_static = "1.5.0"
toml = "0.8.19"
regex = "1.11.1"
indexmap = "2.7.0"
[lints]
workspace = true

View File

@ -1,7 +1,7 @@
use color_eyre::Result;
use indexmap::IndexSet;
use lazy_static::lazy_static;
use regex::Regex;
use std::collections::HashSet;
use tracing::debug;
use crate::cable::{CableChannelPrototype, DEFAULT_DELIMITER};
@ -108,7 +108,7 @@ async fn load_candidates(command: String, injector: Injector<String>) {
let decoded_output = String::from_utf8(output.stdout).unwrap();
debug!("Decoded output: {:?}", decoded_output);
for line in decoded_output.lines().collect::<HashSet<_>>() {
for line in decoded_output.lines().collect::<IndexSet<_>>() {
if !line.trim().is_empty() {
let () = injector.push(line.to_string(), |e, cols| {
cols[0] = e.clone().into();