mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-01 12:24:15 +00:00
Optional serde feature for distribution-filename (#461)
https://github.com/astral-sh/puffin/pull/459#discussion_r1398482972
This commit is contained in:
parent
255edf4445
commit
2fed14fdc6
2 changed files with 4 additions and 1 deletions
|
|
@ -14,7 +14,7 @@ pep440_rs = { path = "../pep440-rs" }
|
|||
platform-tags = { path = "../platform-tags" }
|
||||
puffin-normalize = { path = "../puffin-normalize" }
|
||||
|
||||
serde = { workspace = true }
|
||||
serde = { workspace = true, optional = true }
|
||||
thiserror = { workspace = true }
|
||||
url = { workspace = true }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#[cfg(feature = "serde")]
|
||||
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
||||
use std::fmt::{Display, Formatter};
|
||||
use std::str::FromStr;
|
||||
|
|
@ -168,6 +169,7 @@ impl TryFrom<&Url> for WheelFilename {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
impl<'de> Deserialize<'de> for WheelFilename {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
where
|
||||
|
|
@ -178,6 +180,7 @@ impl<'de> Deserialize<'de> for WheelFilename {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
impl Serialize for WheelFilename {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue