fn match_ptr_count_member(&mut self, m: &mut Member) {
        if !m.is_ptr && m.orig_name.len() > 5 && m.orig_name.contains("Count") {
            // Check for pointers members matching a count member. NOTE: This
            // will never find a match, the spec consistently defines count
            // members before their corresponding pointers.
            //
            // TODO: Implement Irregularities
            let (head, tail) = m.orig_name.split_at(m.orig_name.len() - 5);
            if tail == "Count" {
                for ptr_m in self.members.iter_mut().filter(|ptr_m|
                        (ptr_m.is_ptr || ptr_m.is_ptr_ptr) && ptr_m.orig_name.starts_with("p")) {
                    // let (ptr_first, ptr_tail) = ptr_m.orig_name.split_at(1);
                    let (ptr_pre, ptr_tail) = if m.orig_name.starts_with("pp") {
                        m.orig_name.split_at(2)
                    } else {
                        m.orig_name.split_at(1)
                    };
                    let (ptr_tail_first, ptr_tail_tail) = ptr_tail.split_at(1);
                    let ptr_tail_lower = format!("{}{}", ptr_tail_first.to_lowercase(), ptr_tail_tail);
                    if ptr_tail_lower.contains(head) {
                        if PRINT { println!("Pointer member found matching count member: \
                            ptr: \"{}\", cnt: \"{}\"", ptr_tail_lower, head); }
                        ptr_m.ptr_count_member_orig_name = Some(m.orig_name.clone());
                        m.is_ptr_count = true;
                        // NOTE: Currently unreachable: count always comes first.
                    }
                }
            }
        } else if (m.is_ptr || m.is_ptr_ptr) && m.orig_name.starts_with("p") {
            // Check for a count member matching a pointer member.
            let (ptr_pre, ptr_tail_) = if m.orig_name.starts_with("pp") {
                m.orig_name.split_at(2)
            } else {
                m.orig_name.split_at(1)
            };
            assert!(ptr_pre == "pp" || ptr_pre == "p");
            // Compensate for pointer member name irregularities:
            let mut ptr_tail = ptr_tail_
                .replace("ImageIndices", "Swapchains")
                .replace("ResolveAttachments", "ColorAttachments")
                .replace("Indices", "Indexes")
                .replace("Entries", "Entrys")
                .replace("Dependencies", "Dependencys");
            if self.orig_name == "VkPresentInfoKHR" {
                ptr_tail = ptr_tail.replace("Results", "Swapchains");
            } else if self.orig_name == "VkPresentRegionsKHR" {
                ptr_tail = ptr_tail.replace("Regions", "Swapchains");
            } else if self.orig_name == "VkPresentTimesInfoGOOGLE"  {
                ptr_tail = ptr_tail.replace("Times", "Swapchains");
            }

            let (ptr_tail_first, ptr_tail_tail) = ptr_tail.split_at(1);
            let ptr_tail_lower = format!("{}{}", ptr_tail_first.to_lowercase(), ptr_tail_tail);
            for cnt_m in self.members.iter_mut().filter(|cnt_m| cnt_m.orig_name.len() > 5) {
                // Compensate for count member name irregularities:
                let cnt_orig_name = cnt_m.orig_name
                    .replace("descriptorSet", "setLayout")
                    .replace("SFRRect", "sFRRect")
                    .replace("codeSize", "codeCount");
                let (cnt_head, cnt_tail) = cnt_orig_name.split_at(cnt_orig_name.len() - 5);
                // // Compensate for count member name irregularities:
                // let cnt_head = cnt_head_
                //     .replace("descriptorSet", "setLayout")
                //     .replace("SFRRect", "sFRRect");
                if ptr_tail_lower.contains(&cnt_head) && cnt_tail == "Count" {
                    assert!(ptr_tail_lower.starts_with(&cnt_head));
                    if PRINT { println!("Count member found matching pointer member: \
                            ptr: \"{}\", cnt: \"{}\"", ptr_tail_lower, cnt_head); }

                    // println!("Count member found matching pointer member: \
                    //         ptr: \"{}\", cnt: \"{}\"", ptr_tail_lower, cnt_head);

                    // Damn irregularities ("pCoverageModulationTable")....
                    assert!(m.orig_name.ends_with("s") ||
                        m.orig_name == "pCoverageModulationTable" ||
                        m.orig_name == "pCode");
                    m.ptr_count_member_orig_name = Some(cnt_m.orig_name.clone());
                    cnt_m.is_ptr_count = true;
                }
            }
        }
    }
/// Searches for a member within this struct which matches the naming
/// conventions used to relate pointers with corresponding count fields
/// then marks that relationship.
Searches for a member within this struct which matches the naming
conventions used to relate pointers with corresponding count fields
then marks that relationship.
Searches for a member within this struct which matches the naming conventions used to relate pointers with corresponding count fields then marks that relationship .
fn match_ptr_count_member(&mut self, m: &mut Member) {
        if !m.is_ptr && m.orig_name.len() > 5 && m.orig_name.contains("Count") {
            // Check for pointers members matching a count member. NOTE: This
            // will never find a match, the spec consistently defines count
            // members before their corresponding pointers.
            //
            // TODO: Implement Irregularities
            let (head, tail) = m.orig_name.split_at(m.orig_name.len() - 5);
            if tail == "Count" {
                for ptr_m in self.members.iter_mut().filter(|ptr_m|
                        (ptr_m.is_ptr || ptr_m.is_ptr_ptr) && ptr_m.orig_name.starts_with("p")) {
                    // let (ptr_first, ptr_tail) = ptr_m.orig_name.split_at(1);
                    let (ptr_pre, ptr_tail) = if m.orig_name.starts_with("pp") {
                        m.orig_name.split_at(2)
                    } else {
                        m.orig_name.split_at(1)
                    };
                    let (ptr_tail_first, ptr_tail_tail) = ptr_tail.split_at(1);
                    let ptr_tail_lower = format!("{}{}", ptr_tail_first.to_lowercase(), ptr_tail_tail);
                    if ptr_tail_lower.contains(head) {
                        if PRINT { println!("Pointer member found matching count member: \
                            ptr: \"{}\", cnt: \"{}\"", ptr_tail_lower, head); }
                        ptr_m.ptr_count_member_orig_name = Some(m.orig_name.clone());
                        m.is_ptr_count = true;
                        // NOTE: Currently unreachable: count always comes first.
                    }
                }
            }
        } else if (m.is_ptr || m.is_ptr_ptr) && m.orig_name.starts_with("p") {
            // Check for a count member matching a pointer member.
            let (ptr_pre, ptr_tail_) = if m.orig_name.starts_with("pp") {
                m.orig_name.split_at(2)
            } else {
                m.orig_name.split_at(1)
            };
            assert!(ptr_pre == "pp" || ptr_pre == "p");
            // Compensate for pointer member name irregularities:
            let mut ptr_tail = ptr_tail_
                .replace("ImageIndices", "Swapchains")
                .replace("ResolveAttachments", "ColorAttachments")
                .replace("Indices", "Indexes")
                .replace("Entries", "Entrys")
                .replace("Dependencies", "Dependencys");
            if self.orig_name == "VkPresentInfoKHR" {
                ptr_tail = ptr_tail.replace("Results", "Swapchains");
            } else if self.orig_name == "VkPresentRegionsKHR" {
                ptr_tail = ptr_tail.replace("Regions", "Swapchains");
            } else if self.orig_name == "VkPresentTimesInfoGOOGLE"  {
                ptr_tail = ptr_tail.replace("Times", "Swapchains");
            }
            let (ptr_tail_first, ptr_tail_tail) = ptr_tail.split_at(1);
            let ptr_tail_lower = format!("{}{}", ptr_tail_first.to_lowercase(), ptr_tail_tail);
            for cnt_m in self.members.iter_mut().filter(|cnt_m| cnt_m.orig_name.len() > 5) {
                // Compensate for count member name irregularities:
                let cnt_orig_name = cnt_m.orig_name
                    .replace("descriptorSet", "setLayout")
                    .replace("SFRRect", "sFRRect")
                    .replace("codeSize", "codeCount");
                let (cnt_head, cnt_tail) = cnt_orig_name.split_at(cnt_orig_name.len() - 5);
                // // Compensate for count member name irregularities:
                // let cnt_head = cnt_head_
                //     .replace("descriptorSet", "setLayout")
                //     .replace("SFRRect", "sFRRect");
                if ptr_tail_lower.contains(&cnt_head) && cnt_tail == "Count" {
                    assert!(ptr_tail_lower.starts_with(&cnt_head));
                    if PRINT { println!("Count member found matching pointer member: \
                            ptr: \"{}\", cnt: \"{}\"", ptr_tail_lower, cnt_head); }
                    // println!("Count member found matching pointer member: \
                    //         ptr: \"{}\", cnt: \"{}\"", ptr_tail_lower, cnt_head);
                    // Damn irregularities ("pCoverageModulationTable")....
                    assert!(m.orig_name.ends_with("s") ||
                        m.orig_name == "pCoverageModulationTable" ||
                        m.orig_name == "pCode");
                    m.ptr_count_member_orig_name = Some(cnt_m.orig_name.clone());
                    cnt_m.is_ptr_count = true;
                }
            }
        }
    }
fn match_ptr_count_member ( & mut self , m : & mut Member ) { if ! m . is_ptr && m . orig_name . len ( ) > 5 && m . orig_name . contains ( " " ) { // Check for pointers members matching a count member. NOTE: This // will never find a match, the spec consistently defines count // members before their corresponding pointers. // // TODO: Implement Irregularities let ( head , tail ) = m . orig_name . split_at ( m . orig_name . len ( ) - 5 ) ; if tail == " " { for ptr_m in self . members . iter_mut ( ) . filter ( | ptr_m | ( ptr_m . is_ptr || ptr_m . is_ptr_ptr ) && ptr_m . orig_name . starts_with ( " " ) ) { // let (ptr_first, ptr_tail) = ptr_m.orig_name.split_at(1); let ( ptr_pre , ptr_tail ) = if m . orig_name . starts_with ( " " ) { m . orig_name . split_at ( 2 ) } else { m . orig_name . split_at ( 1 ) } ; let ( ptr_tail_first , ptr_tail_tail ) = ptr_tail . split_at ( 1 ) ; let ptr_tail_lower = format ! ( " " ptr_tail_first to_lowercase ( ) ptr_tail_tail ) ; if ptr_tail_lower . contains ( head ) { if PRINT { println ! ( " \
 \" \" \" \" " ptr_tail_lower head ) ; } ptr_m . ptr_count_member_orig_name = Some ( m . orig_name . clone ( ) ) ; m . is_ptr_count = true ; // NOTE: Currently unreachable: count always comes first. } } } } else if ( m . is_ptr || m . is_ptr_ptr ) && m . orig_name . starts_with ( " " ) { // Check for a count member matching a pointer member. let ( ptr_pre , ptr_tail_ ) = if m . orig_name . starts_with ( " " ) { m . orig_name . split_at ( 2 ) } else { m . orig_name . split_at ( 1 ) } ; assert ! ( ptr_pre " " ptr_pre " " ) ; // Compensate for pointer member name irregularities: let mut ptr_tail = ptr_tail_ . replace ( " " , " " ) . replace ( " " , " " ) . replace ( " " , " " ) . replace ( " " , " " ) . replace ( " " , " " ) ; if self . orig_name == " " { ptr_tail = ptr_tail . replace ( " " , " " ) ; } else if self . orig_name == " " { ptr_tail = ptr_tail . replace ( " " , " " ) ; } else if self . orig_name == " " { ptr_tail = ptr_tail . replace ( " " , " " ) ; } let ( ptr_tail_first , ptr_tail_tail ) = ptr_tail . split_at ( 1 ) ; let ptr_tail_lower = format ! ( " " ptr_tail_first to_lowercase ( ) ptr_tail_tail ) ; for cnt_m in self . members . iter_mut ( ) . filter ( | cnt_m | cnt_m . orig_name . len ( ) > 5 ) { // Compensate for count member name irregularities: let cnt_orig_name = cnt_m . orig_name . replace ( " " , " " ) . replace ( " " , " " ) . replace ( " " , " " ) ; let ( cnt_head , cnt_tail ) = cnt_orig_name . split_at ( cnt_orig_name . len ( ) - 5 ) ; // // Compensate for count member name irregularities: // let cnt_head = cnt_head_ //     .replace("descriptorSet", "setLayout") //     .replace("SFRRect", "sFRRect"); if ptr_tail_lower . contains ( & cnt_head ) && cnt_tail == " " { assert ! ( ptr_tail_lower starts_with ( cnt_head ) ) ; if PRINT { println ! ( " \
 \" \" \" \" " ptr_tail_lower cnt_head ) ; } // println!("Count member found matching pointer member: \ //         ptr: \"{}\", cnt: \"{}\"", ptr_tail_lower, cnt_head); // Damn irregularities ("pCoverageModulationTable").... assert ! ( m orig_name ends_with ( " " ) m orig_name " " m orig_name " " ) ; m . ptr_count_member_orig_name = Some ( cnt_m . orig_name . clone ( ) ) ; cnt_m . is_ptr_count = true ; } } } }
Searches for a member within this struct which matches the naming
conventions used to relate pointers with corresponding count fields
then marks that relationship.
Searches for a member within this struct which matches the naming conventions used to relate pointers with corresponding count fields then marks that relationship .
&mut self
m
&mut Member
&mut self
m
&mut Member