mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Remove wheel filename-from URL conversion (#14223)
## Summary This appears to be unused.
This commit is contained in:
parent
e7f5967111
commit
d9351d52fc
3 changed files with 0 additions and 26 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -5135,7 +5135,6 @@ dependencies = [
|
|||
"serde",
|
||||
"smallvec",
|
||||
"thiserror 2.0.12",
|
||||
"url",
|
||||
"uv-cache-key",
|
||||
"uv-normalize",
|
||||
"uv-pep440",
|
||||
|
|
|
@ -27,7 +27,6 @@ rkyv = { workspace = true, features = ["smallvec-1"] }
|
|||
serde = { workspace = true }
|
||||
smallvec = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
url = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
insta = { version = "1.40.0" }
|
||||
|
|
|
@ -5,7 +5,6 @@ use std::str::FromStr;
|
|||
use memchr::memchr;
|
||||
use serde::{Deserialize, Deserializer, Serialize, Serializer, de};
|
||||
use thiserror::Error;
|
||||
use url::Url;
|
||||
|
||||
use uv_cache_key::cache_digest;
|
||||
use uv_normalize::{InvalidNameError, PackageName};
|
||||
|
@ -300,29 +299,6 @@ impl WheelFilename {
|
|||
}
|
||||
}
|
||||
|
||||
impl TryFrom<&Url> for WheelFilename {
|
||||
type Error = WheelFilenameError;
|
||||
|
||||
fn try_from(url: &Url) -> Result<Self, Self::Error> {
|
||||
let filename = url
|
||||
.path_segments()
|
||||
.ok_or_else(|| {
|
||||
WheelFilenameError::InvalidWheelFileName(
|
||||
url.to_string(),
|
||||
"URL must have a path".to_string(),
|
||||
)
|
||||
})?
|
||||
.next_back()
|
||||
.ok_or_else(|| {
|
||||
WheelFilenameError::InvalidWheelFileName(
|
||||
url.to_string(),
|
||||
"URL must contain a filename".to_string(),
|
||||
)
|
||||
})?;
|
||||
Self::from_str(filename)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'de> Deserialize<'de> for WheelFilename {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue