/// For each lead label, list the positions in the course where calls at that label could start
/// (Monument assumes that all courses always replace one piece of [`PlaceNot`]ation).
For each lead label, list the positions in the course where calls at that label could start
(Monument assumes that all courses always replace one piece of [`PlaceNot`]ation).
For each lead label list the positions in the course where calls at that label could start ( Monument assumes that all courses always replace one piece of [ ` PlaceNot ` ] ation ) .
fn call_starts_by_label(methods: &[super::Method]) -> HashMap<&str, Vec<RowIdx>> {
    let mut label_indices = HashMap::<&str, Vec<RowIdx>>::new();
    // For every method (and the block it will generate) ...
    for (idx, d) in methods.iter().enumerate() {
        let block_idx = BlockIdx::new(idx); // Each method will correspond to one block
        // ... for every labelled row ...
        let course_len = d.plain_course.len();
        for (row_idx, annot) in d.plain_course.annots().enumerate() {
            if let Some(label) = &annot.label {
                // ... mark that a similarly-labelled call could be called just before this label
                let call_start_idx = (row_idx + course_len - 1) % course_len;
                label_indices
                    .entry(label)
                    .or_insert_with(Vec::new)
                    // Calls start at the row **before** the lead label.  We do `+ course_len` to
                    // avoid underflow if `row_idx == 0`.
                    .push(RowIdx::new(block_idx, call_start_idx));
            }
        }
    }
    label_indices
}
fn call_starts_by_label ( methods : & [ super :: Method ] ) -> HashMap < & str , Vec < RowIdx > > { let mut label_indices = HashMap :: < & str , Vec < RowIdx > > :: new ( ) ; // For every method (and the block it will generate) ... for ( idx , d ) in methods . iter ( ) . enumerate ( ) { let block_idx = BlockIdx :: new ( idx ) ; // Each method will correspond to one block // ... for every labelled row ... let course_len = d . plain_course . len ( ) ; for ( row_idx , annot ) in d . plain_course . annots ( ) . enumerate ( ) { if let Some ( label ) = & annot . label { // ... mark that a similarly-labelled call could be called just before this label let call_start_idx = ( row_idx + course_len - 1 ) % course_len ; label_indices . entry ( label ) . or_insert_with ( Vec :: new ) // Calls start at the row **before** the lead label.  We do `+ course_len` to // avoid underflow if `row_idx == 0`. . push ( RowIdx :: new ( block_idx , call_start_idx ) ) ; } } } label_indices }
For each lead label, list the positions in the course where calls at that label could start
(Monument assumes that all courses always replace one piece of [`PlaceNot`]ation).
For each lead label list the positions in the course where calls at that label could start ( Monument assumes that all courses always replace one piece of [ ` PlaceNot ` ] ation ) .
methods
&[super::Method]