pub fn determine_spec(&self, id: &PackageId) -> &'_ PackageSpec {
        let pkg = &self.packages[id];
        pkg.minimal_spec.get_or_init(|| {
            let mut res = PackageSpec {
                name: Some(pkg.name.clone()),
                version: None,
                source: None,
            };
            match pkg.conflicts.get() {
                None => {
                    // The name is sufficent
                }
                Some(PackageConflictKind::Names) => {
                    // Add in version to disambiguate
                    res.version = Some(pkg.version.clone());
                }
                Some(PackageConflictKind::Version) => {
                    // Add in version and source to disambiguate
                    res.version = Some(pkg.version.clone());
                    if let Some(ref src) = pkg.source {
                        res.source = Some(String::from(PackageSpec::source_as_url(src)));
                        assert!(res.is_fully_qualified());
                    } else {
                        // If we don't have a 'source', just hope we're not ambigous..
                    }
                }
            };
            res
        })
    }
/// Determine the minimal specification required to refer to the specified [PackageId]
Determine the minimal specification required to refer to the specified [PackageId]
Determine the minimal specification required to refer to the specified [ PackageId ]
pub fn determine_spec(&self, id: &PackageId) -> &'_ PackageSpec {
        let pkg = &self.packages[id];
        pkg.minimal_spec.get_or_init(|| {
            let mut res = PackageSpec {
                name: Some(pkg.name.clone()),
                version: None,
                source: None,
            };
            match pkg.conflicts.get() {
                None => {
                    // The name is sufficent
                }
                Some(PackageConflictKind::Names) => {
                    // Add in version to disambiguate
                    res.version = Some(pkg.version.clone());
                }
                Some(PackageConflictKind::Version) => {
                    // Add in version and source to disambiguate
                    res.version = Some(pkg.version.clone());
                    if let Some(ref src) = pkg.source {
                        res.source = Some(String::from(PackageSpec::source_as_url(src)));
                        assert!(res.is_fully_qualified());
                    } else {
                        // If we don't have a 'source', just hope we're not ambigous..
                    }
                }
            };
            res
        })
    }
pub fn determine_spec ( & self , id : & PackageId ) -> & ' _ PackageSpec { let pkg = & self . packages [ id ] ; pkg . minimal_spec . get_or_init ( | | { let mut res = PackageSpec { name : Some ( pkg . name . clone ( ) ) , version : None , source : None , } ; match pkg . conflicts . get ( ) { None => { // The name is sufficent } Some ( PackageConflictKind :: Names ) => { // Add in version to disambiguate res . version = Some ( pkg . version . clone ( ) ) ; } Some ( PackageConflictKind :: Version ) => { // Add in version and source to disambiguate res . version = Some ( pkg . version . clone ( ) ) ; if let Some ( ref src ) = pkg . source { res . source = Some ( String :: from ( PackageSpec :: source_as_url ( src ) ) ) ; assert ! ( res is_fully_qualified ( ) ) ; } else { // If we don't have a 'source', just hope we're not ambigous.. } } } ; res } ) }
Determine the minimal specification required to refer to the specified [PackageId]
Determine the minimal specification required to refer to the specified [ PackageId ]
&self
id
&PackageId