Rename DistInfoMetadata to CoreMetadata (#3699)

## Summary

This reflects the change codified in PEP 714.
This commit is contained in:
Charlie Marsh 2024-05-21 14:26:59 -04:00 committed by GitHub
parent fee344db6f
commit cf997080b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 11 deletions

View file

@ -39,9 +39,9 @@ fn sorted_simple_json_files<'de, D: Deserializer<'de>>(d: D) -> Result<Vec<File>
pub struct File {
// PEP 714-renamed field, followed by PEP 691-compliant field, followed by non-PEP 691-compliant
// alias used by PyPI.
pub core_metadata: Option<DistInfoMetadata>,
pub dist_info_metadata: Option<DistInfoMetadata>,
pub data_dist_info_metadata: Option<DistInfoMetadata>,
pub core_metadata: Option<CoreMetadata>,
pub dist_info_metadata: Option<CoreMetadata>,
pub data_dist_info_metadata: Option<CoreMetadata>,
pub filename: String,
pub hashes: Hashes,
/// There are a number of invalid specifiers on PyPI, so we first try to parse it into a
@ -73,12 +73,12 @@ where
#[derive(Debug, Clone, Deserialize)]
#[serde(untagged)]
pub enum DistInfoMetadata {
pub enum CoreMetadata {
Bool(bool),
Hashes(Hashes),
}
impl DistInfoMetadata {
impl CoreMetadata {
pub fn is_available(&self) -> bool {
match self {
Self::Bool(is_available) => *is_available,