Remove wheel filename-from URL conversion (#14223)

## Summary

This appears to be unused.
This commit is contained in:
Charlie Marsh 2025-06-23 14:26:14 -04:00 committed by GitHub
parent e7f5967111
commit d9351d52fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 0 additions and 26 deletions

1
Cargo.lock generated
View file

@ -5135,7 +5135,6 @@ dependencies = [
"serde",
"smallvec",
"thiserror 2.0.12",
"url",
"uv-cache-key",
"uv-normalize",
"uv-pep440",

View file

@ -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" }

View file

@ -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