Skip to content

Commit

Permalink
Remove an unnecessary new method.
Browse files Browse the repository at this point in the history
  • Loading branch information
nfachan committed Oct 28, 2024
1 parent 6c45e56 commit ee2b583
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions crates/maelstrom-worker/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,25 @@ pub struct CacheKey {
}

impl CacheKey {
pub fn new(kind: CacheKeyKind, digest: Sha256Digest) -> Self {
Self { kind, digest }
}

pub fn blob(digest: Sha256Digest) -> Self {
Self::new(CacheKeyKind::Blob, digest)
Self {
kind: CacheKeyKind::Blob,
digest,
}
}

pub fn bottom_fs_layer(digest: Sha256Digest) -> Self {
Self::new(CacheKeyKind::BottomFsLayer, digest)
Self {
kind: CacheKeyKind::BottomFsLayer,
digest,
}
}

pub fn upper_fs_layer(digest: Sha256Digest) -> Self {
Self::new(CacheKeyKind::UpperFsLayer, digest)
Self {
kind: CacheKeyKind::UpperFsLayer,
digest,
}
}
}

Expand Down

0 comments on commit ee2b583

Please sign in to comment.