mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-21 15:52:15 +00:00
Support MD5 hashes (#1556)
## Summary We can add other hashes if necessary, but I don't know that they're really used in practice. Closes https://github.com/astral-sh/uv/issues/1547.
This commit is contained in:
parent
9e0336c28a
commit
c1eb6130e1
4 changed files with 95 additions and 15 deletions
|
@ -678,7 +678,7 @@ impl Identifier for Url {
|
|||
|
||||
impl Identifier for File {
|
||||
fn distribution_id(&self) -> DistributionId {
|
||||
if let Some(hash) = &self.hashes.sha256 {
|
||||
if let Some(hash) = self.hashes.as_str() {
|
||||
DistributionId::new(hash)
|
||||
} else {
|
||||
self.url.distribution_id()
|
||||
|
@ -686,7 +686,7 @@ impl Identifier for File {
|
|||
}
|
||||
|
||||
fn resource_id(&self) -> ResourceId {
|
||||
if let Some(hash) = &self.hashes.sha256 {
|
||||
if let Some(hash) = self.hashes.as_str() {
|
||||
ResourceId::new(hash)
|
||||
} else {
|
||||
self.url.resource_id()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue