computer: convert vecs functions to iterators

This commit is contained in:
nym21
2025-09-10 16:25:38 +02:00
parent dfa077a1c9
commit 9b92c5ce38
47 changed files with 2037 additions and 1330 deletions
+4 -4
View File
@@ -7,14 +7,14 @@ pub struct ByTerm<T> {
}
impl<T> ByTerm<T> {
pub fn as_mut_vec(&mut self) -> [&mut T; 2] {
[&mut self.short, &mut self.long]
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T> {
[&mut self.short, &mut self.long].into_iter()
}
}
impl<T> ByTerm<(GroupFilter, T)> {
pub fn vecs(&self) -> [&T; 2] {
[&self.short.1, &self.long.1]
pub fn iter_right(&self) -> impl Iterator<Item = &T> {
[&self.short.1, &self.long.1].into_iter()
}
}