use super::GroupFilter; #[derive(Default, Clone)] pub struct ByTerm { pub short: T, pub long: T, } impl ByTerm { pub fn iter_mut(&mut self) -> impl Iterator { [&mut self.short, &mut self.long].into_iter() } } impl ByTerm<(GroupFilter, T)> { pub fn iter_right(&self) -> impl Iterator { [&self.short.1, &self.long.1].into_iter() } } impl From> for ByTerm<(GroupFilter, T)> { fn from(value: ByTerm) -> Self { Self { short: (GroupFilter::LowerThan(5 * 30), value.short), long: (GroupFilter::GreaterOrEqual(5 * 30), value.long), } } }