pub(crate) fn cleanup_removed_characteristics(
    module: &mut Module,
    removed_items: &HashSet<String>
) {
    if removed_items.is_empty() {
        return;
    }

    for group in &mut module.group {
        if let Some(ref_characteristic) = &mut group.ref_characteristic {
            cleanup_item_list(&mut ref_characteristic.identifier_list, removed_items);
            if ref_characteristic.identifier_list.is_empty() {
                group.ref_characteristic = None;
            }
        }
    }

    for function in &mut module.function {
        if let Some(def_characteristic) = &mut function.def_characteristic {
            cleanup_item_list(&mut def_characteristic.identifier_list, removed_items);
            if def_characteristic.identifier_list.is_empty() {
                function.def_characteristic = None;
            }
        }
        if let Some(ref_characteristic) = &mut function.ref_characteristic {
            cleanup_item_list(&mut ref_characteristic.identifier_list, removed_items);
            if ref_characteristic.identifier_list.is_empty() {
                function.ref_characteristic = None;
            }
        }
    }
}
// when update runs without preserve, CHARACTERISTICs could be removed from the module
// these items should also be removed from the identifier lists in GROUPs and FUNCTIONs
when update runs without preserve, CHARACTERISTICs could be removed from the module
these items should also be removed from the identifier lists in GROUPs and FUNCTIONs
when update runs without preserve CHARACTERISTICs could be removed from the module these items should also be removed from the identifier lists in GROUPs and FUNCTIONs
pub(crate) fn cleanup_removed_characteristics(
    module: &mut Module,
    removed_items: &HashSet<String>
) {
    if removed_items.is_empty() {
        return;
    }
    for group in &mut module.group {
        if let Some(ref_characteristic) = &mut group.ref_characteristic {
            cleanup_item_list(&mut ref_characteristic.identifier_list, removed_items);
            if ref_characteristic.identifier_list.is_empty() {
                group.ref_characteristic = None;
            }
        }
    }
    for function in &mut module.function {
        if let Some(def_characteristic) = &mut function.def_characteristic {
            cleanup_item_list(&mut def_characteristic.identifier_list, removed_items);
            if def_characteristic.identifier_list.is_empty() {
                function.def_characteristic = None;
            }
        }
        if let Some(ref_characteristic) = &mut function.ref_characteristic {
            cleanup_item_list(&mut ref_characteristic.identifier_list, removed_items);
            if ref_characteristic.identifier_list.is_empty() {
                function.ref_characteristic = None;
            }
        }
    }
}
pub ( crate ) fn cleanup_removed_characteristics ( module : & mut Module , removed_items : & HashSet < String > ) { if removed_items . is_empty ( ) { return ; } for group in & mut module . group { if let Some ( ref_characteristic ) = & mut group . ref_characteristic { cleanup_item_list ( & mut ref_characteristic . identifier_list , removed_items ) ; if ref_characteristic . identifier_list . is_empty ( ) { group . ref_characteristic = None ; } } } for function in & mut module . function { if let Some ( def_characteristic ) = & mut function . def_characteristic { cleanup_item_list ( & mut def_characteristic . identifier_list , removed_items ) ; if def_characteristic . identifier_list . is_empty ( ) { function . def_characteristic = None ; } } if let Some ( ref_characteristic ) = & mut function . ref_characteristic { cleanup_item_list ( & mut ref_characteristic . identifier_list , removed_items ) ; if ref_characteristic . identifier_list . is_empty ( ) { function . ref_characteristic = None ; } } } }
when update runs without preserve, CHARACTERISTICs could be removed from the module
these items should also be removed from the identifier lists in GROUPs and FUNCTIONs
when update runs without preserve CHARACTERISTICs could be removed from the module these items should also be removed from the identifier lists in GROUPs and FUNCTIONs
module
&mut Module
removed_items
&HashSet<String>