pub fn resolve_status(
        &'ela self,
        compat: &ElaborateWorkspace,
        latest: &ElaborateWorkspace,
        options: &Options,
        _config: &Config,
        root: &'ela PackageId,
    ) -> CargoResult<()> {
        self.pkg_status.borrow_mut().clear();
        let (compat_root, latest_root) = if self.workspace_mode {
            (compat.find_member(root)?, latest.find_member(root)?)
        } else {
            (
                compat.determine_root(options)?,
                latest.determine_root(options)?,
            )
        };

        let mut queue = VecDeque::new();
        queue.push_back((vec![root], Some(compat_root), Some(latest_root)));
        while let Some((path, compat_pkg, latest_pkg)) = queue.pop_front() {
            let pkg = path.last().unwrap();
            let depth = path.len() as i32 - 1;
            // generate pkg_status
            let status = PkgStatus {
                compat: Status::from_versions(pkg.version(), compat_pkg.map(|p| p.version())),
                latest: Status::from_versions(pkg.version(), latest_pkg.map(|p| p.version())),
            };
            debug!(
                _config,
                "STATUS => PKG: {}; PATH: {:?}; COMPAT: {:?}; LATEST: {:?}; STATUS: {:?}",
                pkg,
                path,
                compat_pkg,
                latest_pkg,
                status
            );
            self.pkg_status.borrow_mut().insert(path.clone(), status);
            // next layer
            if options.flag_depth.is_none() || depth < options.flag_depth.unwrap() {
                self.pkg_deps[pkg]
                    .keys()
                    .filter(|dep| !path.contains(dep))
                    .for_each(|dep| {
                        let name = dep.name();
                        let compat_pkg = compat_pkg
                            .and_then(|id| compat.pkg_deps.get(id))
                            .map(|dep_map| dep_map.keys())
                            .and_then(|ref mut deps| deps.find(|dep| dep.name() == name));
                        let latest_pkg = latest_pkg
                            .and_then(|id| latest.pkg_deps.get(id))
                            .map(|dep_map| dep_map.keys())
                            .and_then(|ref mut deps| deps.find(|dep| dep.name() == name));
                        let mut path = path.clone();
                        path.push(dep);
                        queue.push_back((path, compat_pkg, latest_pkg));
                    });
            }
        }

        Ok(())
    }
/// Resolve compatible and latest status from the corresponding `ElaborateWorkspace`s
Resolve compatible and latest status from the corresponding `ElaborateWorkspace`s
Resolve compatible and latest status from the corresponding ` ElaborateWorkspace ` s
pub fn resolve_status(
        &'ela self,
        compat: &ElaborateWorkspace,
        latest: &ElaborateWorkspace,
        options: &Options,
        _config: &Config,
        root: &'ela PackageId,
    ) -> CargoResult<()> {
        self.pkg_status.borrow_mut().clear();
        let (compat_root, latest_root) = if self.workspace_mode {
            (compat.find_member(root)?, latest.find_member(root)?)
        } else {
            (
                compat.determine_root(options)?,
                latest.determine_root(options)?,
            )
        };
        let mut queue = VecDeque::new();
        queue.push_back((vec![root], Some(compat_root), Some(latest_root)));
        while let Some((path, compat_pkg, latest_pkg)) = queue.pop_front() {
            let pkg = path.last().unwrap();
            let depth = path.len() as i32 - 1;
            // generate pkg_status
            let status = PkgStatus {
                compat: Status::from_versions(pkg.version(), compat_pkg.map(|p| p.version())),
                latest: Status::from_versions(pkg.version(), latest_pkg.map(|p| p.version())),
            };
            debug!(
                _config,
                "STATUS => PKG: {}; PATH: {:?}; COMPAT: {:?}; LATEST: {:?}; STATUS: {:?}",
                pkg,
                path,
                compat_pkg,
                latest_pkg,
                status
            );
            self.pkg_status.borrow_mut().insert(path.clone(), status);
            // next layer
            if options.flag_depth.is_none() || depth < options.flag_depth.unwrap() {
                self.pkg_deps[pkg]
                    .keys()
                    .filter(|dep| !path.contains(dep))
                    .for_each(|dep| {
                        let name = dep.name();
                        let compat_pkg = compat_pkg
                            .and_then(|id| compat.pkg_deps.get(id))
                            .map(|dep_map| dep_map.keys())
                            .and_then(|ref mut deps| deps.find(|dep| dep.name() == name));
                        let latest_pkg = latest_pkg
                            .and_then(|id| latest.pkg_deps.get(id))
                            .map(|dep_map| dep_map.keys())
                            .and_then(|ref mut deps| deps.find(|dep| dep.name() == name));
                        let mut path = path.clone();
                        path.push(dep);
                        queue.push_back((path, compat_pkg, latest_pkg));
                    });
            }
        }
        Ok(())
    }
pub fn resolve_status ( & ' ela self , compat : & ElaborateWorkspace , latest : & ElaborateWorkspace , options : & Options , _config : & Config , root : & ' ela PackageId , ) -> CargoResult < ( ) > { self . pkg_status . borrow_mut ( ) . clear ( ) ; let ( compat_root , latest_root ) = if self . workspace_mode { ( compat . find_member ( root ) ? , latest . find_member ( root ) ? ) } else { ( compat . determine_root ( options ) ? , latest . determine_root ( options ) ? , ) } ; let mut queue = VecDeque :: new ( ) ; queue . push_back ( ( vec ! [ root ] , Some ( compat_root ) , Some ( latest_root ) ) ) ; while let Some ( ( path , compat_pkg , latest_pkg ) ) = queue . pop_front ( ) { let pkg = path . last ( ) . unwrap ( ) ; let depth = path . len ( ) as i32 - 1 ; // generate pkg_status let status = PkgStatus { compat : Status :: from_versions ( pkg . version ( ) , compat_pkg . map ( | p | p . version ( ) ) ) , latest : Status :: from_versions ( pkg . version ( ) , latest_pkg . map ( | p | p . version ( ) ) ) , } ; debug ! ( _config " " pkg path compat_pkg latest_pkg status ) ; self . pkg_status . borrow_mut ( ) . insert ( path . clone ( ) , status ) ; // next layer if options . flag_depth . is_none ( ) || depth < options . flag_depth . unwrap ( ) { self . pkg_deps [ pkg ] . keys ( ) . filter ( | dep | ! path . contains ( dep ) ) . for_each ( | dep | { let name = dep . name ( ) ; let compat_pkg = compat_pkg . and_then ( | id | compat . pkg_deps . get ( id ) ) . map ( | dep_map | dep_map . keys ( ) ) . and_then ( | ref mut deps | deps . find ( | dep | dep . name ( ) == name ) ) ; let latest_pkg = latest_pkg . and_then ( | id | latest . pkg_deps . get ( id ) ) . map ( | dep_map | dep_map . keys ( ) ) . and_then ( | ref mut deps | deps . find ( | dep | dep . name ( ) == name ) ) ; let mut path = path . clone ( ) ; path . push ( dep ) ; queue . push_back ( ( path , compat_pkg , latest_pkg ) ) ; } ) ; } } Ok ( ( ) ) }
Resolve compatible and latest status from the corresponding `ElaborateWorkspace`s
Resolve compatible and latest status from the corresponding ` ElaborateWorkspace ` s
&'ela self
compat
&ElaborateWorkspace
latest
&ElaborateWorkspace
options
&Options
_config
&Config
root
&'ela PackageId