mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Use puffin_cache::digest
in another site (#289)
This commit is contained in:
parent
0c9e975f75
commit
2ee555df7b
3 changed files with 1 additions and 11 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2100,11 +2100,9 @@ name = "puffin-distribution"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"hex",
|
||||
"pep440_rs 0.3.12",
|
||||
"puffin-cache",
|
||||
"puffin-package",
|
||||
"sha2",
|
||||
"url",
|
||||
]
|
||||
|
||||
|
|
|
@ -15,6 +15,4 @@ puffin-cache = { path = "../puffin-cache" }
|
|||
puffin-package = { path = "../puffin-package" }
|
||||
|
||||
anyhow = { workspace = true }
|
||||
hex = { workspace = true }
|
||||
sha2 = { workspace = true }
|
||||
url = { workspace = true }
|
||||
|
|
|
@ -3,7 +3,6 @@ use std::path::{Path, PathBuf};
|
|||
use std::str::FromStr;
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use sha2::{Digest, Sha256};
|
||||
use url::Url;
|
||||
|
||||
use pep440_rs::Version;
|
||||
|
@ -358,12 +357,7 @@ impl<'a> RemoteDistributionRef<'a> {
|
|||
Self::Registry(name, version, _) => {
|
||||
format!("{}-{}", DistInfoName::from(*name), version)
|
||||
}
|
||||
Self::Url(_name, url) => {
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.update(url.as_str().as_bytes());
|
||||
let result = hasher.finalize();
|
||||
hex::encode(result)
|
||||
}
|
||||
Self::Url(_name, url) => puffin_cache::digest(&CanonicalUrl::new(url)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue