global: one big snapshot

This commit is contained in:
nym21
2025-08-02 16:59:22 +02:00
parent aa8b47a3dd
commit f7aa9424db
252 changed files with 6283 additions and 5264 deletions
+28
View File
@@ -0,0 +1,28 @@
use super::GroupFilter;
#[derive(Default, Clone)]
pub struct ByTerm<T> {
pub short: T,
pub long: T,
}
impl<T> ByTerm<T> {
pub fn as_mut_vec(&mut self) -> [&mut T; 2] {
[&mut self.short, &mut self.long]
}
}
impl<T> ByTerm<(GroupFilter, T)> {
pub fn vecs(&self) -> [&T; 2] {
[&self.short.1, &self.long.1]
}
}
impl<T> From<ByTerm<T>> for ByTerm<(GroupFilter, T)> {
fn from(value: ByTerm<T>) -> Self {
Self {
short: (GroupFilter::LowerThan(5 * 30), value.short),
long: (GroupFilter::GreaterOrEqual(5 * 30), value.long),
}
}
}