/// Given `driving_names`, marches the whole set of names that can march with them.
/// (Adding an additional name to `driving_names` will result in the same behavior,
///  or a panic, in the case that the new name can't be marched with the existing ones.)
///
/// This takes a `Vec` of `Name` instead of just one because a particular name might
/// not be transcribed at all here, and thus can't tell us how to repeat.
Given `driving_names`, marches the whole set of names that can march with them.
(Adding an additional name to `driving_names` will result in the same behavior,
or a panic, in the case that the new name can't be marched with the existing ones.)

This takes a `Vec` of `Name` instead of just one because a particular name might
not be transcribed at all here, and thus can't tell us how to repeat.
Given ` driving_names ` marches the whole set of names that can march with them . ( Adding an additional name to ` driving_names ` will result in the same behavior or a panic in the case that the new name can ' t be marched with the existing ones . ) This takes a ` Vec ` of ` Name ` instead of just one because a particular name might not be transcribed at all here and thus can ' t tell us how to repeat .
pub fn march_all(&self, driving_names: &[Name]) -> Vec<EnvMBE<T>> {
        let mut march_loc: Option<(usize, Name)> = None;
        for &n in driving_names {
            match (march_loc, self.leaf_locations.find(&n).unwrap_or(&None)) {
                (_, &None) => {}
                (None, &Some(loc)) => march_loc = Some((loc, n)),
                (Some((old_loc, old_name)), &Some(new_loc)) => {
                    if old_loc != new_loc {
                        panic!(
                            "{:#?} and {:#?} cannot march together; they weren't matched to have \
                             the same number of repeats",
                            old_name, n
                        );
                    }
                }
            }
        }
        let march_loc = match march_loc {
            None => {
                return vec![];
            } // FOOTGUN: assume that it is repeated zero times
            Some((loc, _)) => loc,
        };
        let mut result = vec![];
        for marched_out in self.repeats[march_loc].iter() {
            // TODO: should we allow cross-product marching by keeping around unused repeats?
            // Don't lose the current leaves:
            result
                .push(EnvMBE::new_from_leaves(self.leaves.clone()).combine_overriding(marched_out));
        }
        result
    }
pub fn march_all ( & self , driving_names : & [ Name ] ) -> Vec < EnvMBE < T > > { let mut march_loc : Option < ( usize , Name ) > = None ; for & n in driving_names { match ( march_loc , self . leaf_locations . find ( & n ) . unwrap_or ( & None ) ) { ( _ , & None ) => { } ( None , & Some ( loc ) ) => march_loc = Some ( ( loc , n ) ) , ( Some ( ( old_loc , old_name ) ) , & Some ( new_loc ) ) => { if old_loc != new_loc { panic ! ( " \
 " old_name n ) ; } } } } let march_loc = match march_loc { None => { return vec ! [ ] ; } // FOOTGUN: assume that it is repeated zero times Some ( ( loc , _ ) ) => loc , } ; let mut result = vec ! [ ] ; for marched_out in self . repeats [ march_loc ] . iter ( ) { // TODO: should we allow cross-product marching by keeping around unused repeats? // Don't lose the current leaves: result . push ( EnvMBE :: new_from_leaves ( self . leaves . clone ( ) ) . combine_overriding ( marched_out ) ) ; } result }
Given `driving_names`, marches the whole set of names that can march with them.
Given ` driving_names ` marches the whole set of names that can march with them .
&self
driving_names
&[Name]