/// Returns a vector of groups representing the given character map.
///
/// The groups are returned in order of increasing `start_char_code`.
///
/// See [`compile_groups`] for usage examples.
Returns a vector of groups representing the given character map.
The groups are returned in order of increasing `start_char_code`.

See [`compile_groups`] for usage examples.
Returns a vector of groups representing the given character map . The groups are returned in order of increasing ` start_char_code ` . See [ ` compile_groups ` ] for usage examples .
pub fn form_groups(map: &CharacterMap) -> Vec<SequentialMapGroup> {
    let mut groups: Vec<SequentialMapGroup> = Vec::new();
    let mut spans = map.iter().spans_by_key(
        |(&code, &gid)| (code as u32, gid),
        |(code_a, gid_a), (code_b, gid_b)| code_a + 1 == code_b && gid_a + 1 == gid_b,
    );
    while let Some(mut span) = spans.next() {
        let (&start_char, &start_glyph_id) = span.next().unwrap();
        let end_char = span.last().map_or(start_char, |(&x, _)| x);
        let group = SequentialMapGroup {
            start_char_code: start_char as u32,
            end_char_code: end_char as u32,
            start_glyph_id,
        };
        groups.push(group);
    }
    groups
}
pub fn form_groups ( map : & CharacterMap ) -> Vec < SequentialMapGroup > { let mut groups : Vec < SequentialMapGroup > = Vec :: new ( ) ; let mut spans = map . iter ( ) . spans_by_key ( | ( & code , & gid ) | ( code as u32 , gid ) , | ( code_a , gid_a ) , ( code_b , gid_b ) | code_a + 1 == code_b && gid_a + 1 == gid_b , ) ; while let Some ( mut span ) = spans . next ( ) { let ( & start_char , & start_glyph_id ) = span . next ( ) . unwrap ( ) ; let end_char = span . last ( ) . map_or ( start_char , | ( & x , _ ) | x ) ; let group = SequentialMapGroup { start_char_code : start_char as u32 , end_char_code : end_char as u32 , start_glyph_id , } ; groups . push ( group ) ; } groups }
Returns a vector of groups representing the given character map.
Returns a vector of groups representing the given character map .
map
&CharacterMap