pub fn hash_for_package(&self, url: &PkgUrl) -> Option<Hash> {
        let hash = url.package_hash();
        let url = url.strip_hash();
        self.contents.iter().find_map(|candidate| {
            if url == candidate.strip_hash() {
                let candidate_hash = candidate.package_hash();
                match hash {
                    None => Some(candidate_hash),
                    Some(hash) if hash == &candidate_hash => Some(candidate_hash),
                    _ => None,
                }
            } else {
                None
            }
        })
    }
/// Get the hash for a package.
Get the hash for a package.
Get the hash for a package .
pub fn hash_for_package(&self, url: &PkgUrl) -> Option<Hash> {
        let hash = url.package_hash();
        let url = url.strip_hash();
        self.contents.iter().find_map(|candidate| {
            if url == candidate.strip_hash() {
                let candidate_hash = candidate.package_hash();
                match hash {
                    None => Some(candidate_hash),
                    Some(hash) if hash == &candidate_hash => Some(candidate_hash),
                    _ => None,
                }
            } else {
                None
            }
        })
    }
pub fn hash_for_package ( & self , url : & PkgUrl ) -> Option < Hash > { let hash = url . package_hash ( ) ; let url = url . strip_hash ( ) ; self . contents . iter ( ) . find_map ( | candidate | { if url == candidate . strip_hash ( ) { let candidate_hash = candidate . package_hash ( ) ; match hash { None => Some ( candidate_hash ) , Some ( hash ) if hash == & candidate_hash => Some ( candidate_hash ) , _ => None , } } else { None } } ) }
Get the hash for a package.
Get the hash for a package .
&self
url
&PkgUrl
&self
url
&PkgUrl