From 0274aa528f7f3101ebcf5c7b69971e9522f20be3 Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Mon, 5 Aug 2024 18:29:55 +0200 Subject: [PATCH] Rename `Metafiles` to `Metafile` Change requested during the review process. Signed-off-by: Flavio Castelli --- tough/src/editor/mod.rs | 10 +++++----- tough/src/schema/mod.rs | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tough/src/editor/mod.rs b/tough/src/editor/mod.rs index d678e6453..6ec91b278 100644 --- a/tough/src/editor/mod.rs +++ b/tough/src/editor/mod.rs @@ -17,7 +17,7 @@ use crate::key_source::KeySource; use crate::schema::decoded::{Decoded, Hex}; use crate::schema::key::Key; use crate::schema::{ - Hashes, KeyHolder, Metafiles, PathSet, Role, RoleType, Root, Signed, Snapshot, Target, Targets, + Hashes, KeyHolder, Metafile, PathSet, Role, RoleType, Root, Signed, Snapshot, Target, Targets, Timestamp, }; use crate::transport::{IntoVec, Transport}; @@ -702,11 +702,11 @@ impl RepositoryEditor { /// Build a `Metafiles` struct from a given `SignedRole`. This metadata /// includes the sha256 and length of the signed role. - fn snapshot_meta(role: &SignedRole) -> Metafiles + fn snapshot_meta(role: &SignedRole) -> Metafile where R: Role, { - Metafiles { + Metafile { hashes: Some(Hashes { sha256: role.sha256.to_vec().into(), _extra: HashMap::new(), @@ -740,11 +740,11 @@ impl RepositoryEditor { /// Build a `Metafiles` struct from a given `SignedRole`. This metadata /// includes the sha256 and length of the signed role. - fn timestamp_meta(role: &SignedRole) -> Metafiles + fn timestamp_meta(role: &SignedRole) -> Metafile where R: Role, { - Metafiles { + Metafile { hashes: Some(Hashes { sha256: role.sha256.to_vec().into(), _extra: HashMap::new(), diff --git a/tough/src/schema/mod.rs b/tough/src/schema/mod.rs index e9d537d30..8508138c9 100644 --- a/tough/src/schema/mod.rs +++ b/tough/src/schema/mod.rs @@ -260,7 +260,7 @@ pub struct Snapshot { /// describes the hash key in 4.4: METAPATH is the file path of the metadata on the repository /// relative to the metadata base URL. For snapshot.json, these are top-level targets metadata /// and delegated targets metadata. - pub meta: HashMap, + pub meta: HashMap, /// Extra arguments found during deserialization. /// @@ -292,7 +292,7 @@ pub struct Snapshot { /// }, /// ``` #[derive(Debug, Clone, Deserialize, Serialize, Eq, PartialEq)] -pub struct Metafiles { +pub struct Metafile { /// LENGTH is the integer length in bytes of the metadata file at METAPATH. It is OPTIONAL and /// can be omitted to reduce the snapshot metadata file size. In that case the client MUST use a /// custom download limit for the listed metadata. @@ -1112,7 +1112,7 @@ pub struct Timestamp { /// METAFILES is the same as described for the snapshot.json file. In the case of the /// timestamp.json file, this MUST only include a description of the snapshot.json file. - pub meta: HashMap, + pub meta: HashMap, /// Extra arguments found during deserialization. ///