mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-01 20:31:12 +00:00
uv-normalize: make "name" types implement Default
Interestingly, the empty string appears to be valid for these types. I'm not sure if that's intended, but having a Default impl is useful for use with `std::mem::take`.
This commit is contained in:
parent
7fce59e4bc
commit
cd1fc7c9a3
3 changed files with 3 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ use crate::{validate_and_normalize_owned, validate_and_normalize_ref, InvalidNam
|
|||
/// See:
|
||||
/// - <https://peps.python.org/pep-0685/#specification/>
|
||||
/// - <https://packaging.python.org/en/latest/specifications/name-normalization/>
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize)]
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize)]
|
||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||
pub struct ExtraName(String);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use crate::{validate_and_normalize_owned, validate_and_normalize_ref, InvalidNam
|
|||
/// See:
|
||||
/// - <https://peps.python.org/pep-0735/>
|
||||
/// - <https://packaging.python.org/en/latest/specifications/name-normalization/>
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize)]
|
||||
#[derive(Debug, Default, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize)]
|
||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||
pub struct GroupName(String);
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ use crate::{validate_and_normalize_owned, validate_and_normalize_ref, InvalidNam
|
|||
/// See: <https://packaging.python.org/en/latest/specifications/name-normalization/>
|
||||
#[derive(
|
||||
Debug,
|
||||
Default,
|
||||
Clone,
|
||||
PartialEq,
|
||||
Eq,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue