Оптимизирована работа с памятью

This commit is contained in:
2026-04-17 19:14:38 +03:00
parent c3056010eb
commit e06b55ad07
7 changed files with 184 additions and 124 deletions

View File

@@ -564,6 +564,20 @@ impl LogoRegistry {
log::warn!("No logo found for team='{}', sport='{}'", team, sport);
None
}
/// Оставляет только указанные команды, удаляя все остальные
pub fn retain<F>(&mut self, mut predicate: F)
where
F: FnMut(&str, &str) -> bool,
{
self.logos.retain(|(team, sport), _| predicate(team, sport));
}
/// Возвращает количество записей в реестре
pub fn len(&self) -> usize {
self.logos.len()
}
}
fn parse_date(s: &str) -> (NaiveDate, String) {