pub fn accumulate_iterator(&mut self, iterator: impl Iterator<Item = Bell>) {
        // We can't inline this if statement, because doing so would require us to clone the
        // Change or anger the borrow checker.
        if self.using_second_change {
            self.change_2
                .multiply_iterator_into(iterator, &mut self.change_1);
        } else {
            self.change_1
                .multiply_iterator_into(iterator, &mut self.change_2);
        }

        // Swap the buffers so that the result is in the 'front' buffer
        self.using_second_change = !self.using_second_change;
    }
/// Accumulate an [Iterator] representing a permutation onto the accumulator.
///
/// # Example
/// ```
/// use bellmetal::{Bell, Change, ChangeAccumulator, Stage};
///
/// // An array of Bells representing the change '1342'
/// let bells = [Bell::from('1'), Bell::from('3'), Bell::from('4'), Bell::from('2')];
///
/// let mut accum = ChangeAccumulator::new(Stage::MINIMUS);
///
/// accum.accumulate_iterator(bells.iter().map(|x| Bell::from(*x)));
/// accum.accumulate_iterator(bells.iter().map(|x| Bell::from(*x)));
///
/// // '1342' applied twice makes '1423'
/// assert_eq!(accum.total(), &Change::from("1423"));
/// ```
Accumulate an [Iterator] representing a permutation onto the accumulator.
Accumulate an [ Iterator ] representing a permutation onto the accumulator .
pub fn accumulate_iterator(&mut self, iterator: impl Iterator<Item = Bell>) {
        // We can't inline this if statement, because doing so would require us to clone the
        // Change or anger the borrow checker.
        if self.using_second_change {
            self.change_2
                .multiply_iterator_into(iterator, &mut self.change_1);
        } else {
            self.change_1
                .multiply_iterator_into(iterator, &mut self.change_2);
        }
        // Swap the buffers so that the result is in the 'front' buffer
        self.using_second_change = !self.using_second_change;
    }
pub fn accumulate_iterator ( & mut self , iterator : impl Iterator < Item = Bell > ) { // We can't inline this if statement, because doing so would require us to clone the // Change or anger the borrow checker. if self . using_second_change { self . change_2 . multiply_iterator_into ( iterator , & mut self . change_1 ) ; } else { self . change_1 . multiply_iterator_into ( iterator , & mut self . change_2 ) ; } // Swap the buffers so that the result is in the 'front' buffer self . using_second_change = ! self . using_second_change ; }
Accumulate an [Iterator] representing a permutation onto the accumulator.
Accumulate an [ Iterator ] representing a permutation onto the accumulator .
&mut self
iterator
impl Iterator<Item = Bell>
&mut self
iterator
impl Iterator<Item = Bell>
example
```
use bellmetal::{Bell, Change, ChangeAccumulator, Stage}.



let mut accum = ChangeAccumulator::new(Stage::MINIMUS).

accum.accumulate_iterator(bells.iter().map(|x| Bell::from(*x)));
accum.accumulate_iterator(bells.iter().map(|x| Bell::from(*x))).


` ` ` use bellmetal :: { Bell Change ChangeAccumulator Stage } . let mut accum = ChangeAccumulator :: new ( Stage :: MINIMUS ) . accum . accumulate_iterator ( bells . iter () . map ( |x| Bell :: from ( * x ))) ; accum . accumulate_iterator ( bells . iter () . map ( |x| Bell :: from ( * x ))) .