fn assign_subdeps(packages: &mut Vec<Package>, updated_ids: &HashMap<u32, u32>) {
        // We run through the non-cleaned deps first, since the parent may point to
        // one that didn't make the cut, including cases where the versions were identical.
        let packs2 = packages.clone(); // to search
        for package in packages.iter_mut() {
            let mut children: Vec<(u32, String, Version)> = packs2
                .iter()
                .filter_map(|p| {
                    // If there were multiple instances of this dep, the parent id may have been updated.
                    let parent_id = match updated_ids.get(&p.parent) {
                        Some(updated_parent) => *updated_parent,
                        None => p.parent,
                    };
                    if parent_id == package.id {
                        Some((p.id, p.name.clone(), p.version.clone()))
                    } else {
                        None
                    }
                })
                .collect();
            package.deps.append(&mut children);
        }
    }
/// Assign dependencies to packages-to-install, for use in the lock file.
/// Do this only after the dependencies are resolved.
Assign dependencies to packages-to-install, for use in the lock file.
Do this only after the dependencies are resolved.
Assign dependencies to packages - to - install for use in the lock file . Do this only after the dependencies are resolved .
fn assign_subdeps(packages: &mut Vec<Package>, updated_ids: &HashMap<u32, u32>) {
        // We run through the non-cleaned deps first, since the parent may point to
        // one that didn't make the cut, including cases where the versions were identical.
        let packs2 = packages.clone(); // to search
        for package in packages.iter_mut() {
            let mut children: Vec<(u32, String, Version)> = packs2
                .iter()
                .filter_map(|p| {
                    // If there were multiple instances of this dep, the parent id may have been updated.
                    let parent_id = match updated_ids.get(&p.parent) {
                        Some(updated_parent) => *updated_parent,
                        None => p.parent,
                    };
                    if parent_id == package.id {
                        Some((p.id, p.name.clone(), p.version.clone()))
                    } else {
                        None
                    }
                })
                .collect();
            package.deps.append(&mut children);
        }
    }
fn assign_subdeps ( packages : & mut Vec < Package > , updated_ids : & HashMap < u32 , u32 > ) { // We run through the non-cleaned deps first, since the parent may point to // one that didn't make the cut, including cases where the versions were identical. let packs2 = packages . clone ( ) ; // to search for package in packages . iter_mut ( ) { let mut children : Vec < ( u32 , String , Version ) > = packs2 . iter ( ) . filter_map ( | p | { // If there were multiple instances of this dep, the parent id may have been updated. let parent_id = match updated_ids . get ( & p . parent ) { Some ( updated_parent ) => * updated_parent , None => p . parent , } ; if parent_id == package . id { Some ( ( p . id , p . name . clone ( ) , p . version . clone ( ) ) ) } else { None } } ) . collect ( ) ; package . deps . append ( & mut children ) ; } }
Assign dependencies to packages-to-install, for use in the lock file.
Assign dependencies to packages - to - install for use in the lock file .
packages
&mut Vec<Package>
updated_ids
&HashMap<u32, u32>
packages
&mut Vec<Package>
updated_ids
&HashMap<u32, u32>