pub fn source_id(&self, config: &Config) -> CargoResult<MaybeWorkspace<SourceId>> {
        match &self.source.as_ref() {
            Some(Source::Registry(_)) | None => {
                if let Some(r) = self.registry() {
                    let source_id = SourceId::alt_registry(config, r)?;
                    Ok(MaybeWorkspace::Other(source_id))
                } else {
                    let source_id = SourceId::crates_io(config)?;
                    Ok(MaybeWorkspace::Other(source_id))
                }
            }
            Some(Source::Path(source)) => Ok(MaybeWorkspace::Other(source.source_id()?)),
            Some(Source::Git(source)) => Ok(MaybeWorkspace::Other(source.source_id()?)),
            Some(Source::Workspace(workspace)) => Ok(MaybeWorkspace::Workspace(workspace.clone())),
        }
    }
/// Get the SourceID for this dependency
Get the SourceID for this dependency
Get the SourceID for this dependency
pub fn source_id(&self, config: &Config) -> CargoResult<MaybeWorkspace<SourceId>> {
        match &self.source.as_ref() {
            Some(Source::Registry(_)) | None => {
                if let Some(r) = self.registry() {
                    let source_id = SourceId::alt_registry(config, r)?;
                    Ok(MaybeWorkspace::Other(source_id))
                } else {
                    let source_id = SourceId::crates_io(config)?;
                    Ok(MaybeWorkspace::Other(source_id))
                }
            }
            Some(Source::Path(source)) => Ok(MaybeWorkspace::Other(source.source_id()?)),
            Some(Source::Git(source)) => Ok(MaybeWorkspace::Other(source.source_id()?)),
            Some(Source::Workspace(workspace)) => Ok(MaybeWorkspace::Workspace(workspace.clone())),
        }
    }
pub fn source_id ( & self , config : & Config ) -> CargoResult < MaybeWorkspace < SourceId > > { match & self . source . as_ref ( ) { Some ( Source :: Registry ( _ ) ) | None => { if let Some ( r ) = self . registry ( ) { let source_id = SourceId :: alt_registry ( config , r ) ? ; Ok ( MaybeWorkspace :: Other ( source_id ) ) } else { let source_id = SourceId :: crates_io ( config ) ? ; Ok ( MaybeWorkspace :: Other ( source_id ) ) } } Some ( Source :: Path ( source ) ) => Ok ( MaybeWorkspace :: Other ( source . source_id ( ) ? ) ) , Some ( Source :: Git ( source ) ) => Ok ( MaybeWorkspace :: Other ( source . source_id ( ) ? ) ) , Some ( Source :: Workspace ( workspace ) ) => Ok ( MaybeWorkspace :: Workspace ( workspace . clone ( ) ) ) , } }
Get the SourceID for this dependency
Get the SourceID for this dependency
&self
config
&Config
&self
config
&Config