Add laps count in dictionary test

This commit is contained in:
2026-02-24 14:44:20 +03:00
parent 6268b0ab33
commit 33ee6d43df
4 changed files with 42 additions and 73 deletions
+3 -3
View File
@@ -254,7 +254,7 @@ impl DictionaryState {
fn update_tags(&mut self) {
let mut tags_list: Vec<String> = vec![];
for element in &self.dict {
tags_list.append(&mut to_tags_list(element.tags.clone()));
tags_list.append(&mut split_with_coma(element.tags.clone()));
}
let current_tags = self
@@ -291,7 +291,7 @@ impl DictionaryState {
}
for i in 0..self.include_map.len() {
let tags = to_tags_list(self.dict[i].tags.clone());
let tags = split_with_coma(self.dict[i].tags.clone());
if tags.iter().any(|t| include_tags.contains(t)) {
self.include_map[i] = true;
}
@@ -299,7 +299,7 @@ impl DictionaryState {
}
}
fn to_tags_list(ts: String) -> Vec<String> {
pub fn split_with_coma(ts: String) -> Vec<String> {
ts.split(',')
.map(|ts| ts.to_lowercase().trim().to_string())
.filter(|t| !t.is_empty())