Skip to content

Commit

Permalink
Rename Metafiles to Metafile
Browse files Browse the repository at this point in the history
Change requested during the review process.

Signed-off-by: Flavio Castelli <[email protected]>
  • Loading branch information
flavio committed Aug 5, 2024
1 parent ff2625e commit 0274aa5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions tough/src/editor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -702,11 +702,11 @@ impl RepositoryEditor {

/// Build a `Metafiles` struct from a given `SignedRole<R>`. This metadata
/// includes the sha256 and length of the signed role.
fn snapshot_meta<R>(role: &SignedRole<R>) -> Metafiles
fn snapshot_meta<R>(role: &SignedRole<R>) -> Metafile
where
R: Role,
{
Metafiles {
Metafile {
hashes: Some(Hashes {
sha256: role.sha256.to_vec().into(),
_extra: HashMap::new(),
Expand Down Expand Up @@ -740,11 +740,11 @@ impl RepositoryEditor {

/// Build a `Metafiles` struct from a given `SignedRole<R>`. This metadata
/// includes the sha256 and length of the signed role.
fn timestamp_meta<R>(role: &SignedRole<R>) -> Metafiles
fn timestamp_meta<R>(role: &SignedRole<R>) -> Metafile
where
R: Role,
{
Metafiles {
Metafile {
hashes: Some(Hashes {
sha256: role.sha256.to_vec().into(),
_extra: HashMap::new(),
Expand Down
6 changes: 3 additions & 3 deletions tough/src/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Metafiles>,
pub meta: HashMap<String, Metafile>,

/// Extra arguments found during deserialization.
///
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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<String, Metafiles>,
pub meta: HashMap<String, Metafile>,

/// Extra arguments found during deserialization.
///
Expand Down

0 comments on commit 0274aa5

Please sign in to comment.