fn check_source(&self, loc: &DirectRes) -> Option<PathBuf> {
        match loc {
            DirectRes::Dir { path } => Some(path.clone()),
            // Note: we will always assume that a git repository is out of date, because, well,
            // it could be! The Retriever keeps track of if we've updated a git repository during
            // this invocation
            DirectRes::Git { .. } => None,
            _ => {
                let path = self.layout.src.join(Self::get_source_dir(loc));
                if path.exists() {
                    Some(path)
                } else {
                    None
                }
            }
        }
    }
/// Check if package is downloaded and in the cache. If so, returns the path of source of the cached
/// package.
Check if package is downloaded and in the cache. If so, returns the path of source of the cached
package.
Check if package is downloaded and in the cache . If so returns the path of source of the cached package .
fn check_source(&self, loc: &DirectRes) -> Option<PathBuf> {
        match loc {
            DirectRes::Dir { path } => Some(path.clone()),
            // Note: we will always assume that a git repository is out of date, because, well,
            // it could be! The Retriever keeps track of if we've updated a git repository during
            // this invocation
            DirectRes::Git { .. } => None,
            _ => {
                let path = self.layout.src.join(Self::get_source_dir(loc));
                if path.exists() {
                    Some(path)
                } else {
                    None
                }
            }
        }
    }
fn check_source ( & self , loc : & DirectRes ) -> Option < PathBuf > { match loc { DirectRes :: Dir { path } => Some ( path . clone ( ) ) , // Note: we will always assume that a git repository is out of date, because, well, // it could be! The Retriever keeps track of if we've updated a git repository during // this invocation DirectRes :: Git { .. } => None , _ => { let path = self . layout . src . join ( Self :: get_source_dir ( loc ) ) ; if path . exists ( ) { Some ( path ) } else { None } } } }
Check if package is downloaded and in the cache.
Check if package is downloaded and in the cache .
&self
loc
&DirectRes