From d62c6e642deaae04edccd9256a7d193ce1b3656e Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 18 Mar 2024 15:23:13 +0200 Subject: refactor(tvix/store/nar): use B3Digest in RenderError Ensure consistent formatting of blake3 digests. It looks like we don't actually construct these error types anywhere, so no code needs to be refactored to it currently, but still good to be consistent. Change-Id: I49dc8a7f3cb4245ac06b9a6a44b72060434a3d32 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11193 Reviewed-by: Connor Brewster Tested-by: BuildkiteCI Autosubmit: flokli --- tvix/store/src/nar/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tvix') diff --git a/tvix/store/src/nar/mod.rs b/tvix/store/src/nar/mod.rs index c1a7fc2a933f..49bb92fb0f0f 100644 --- a/tvix/store/src/nar/mod.rs +++ b/tvix/store/src/nar/mod.rs @@ -1,4 +1,3 @@ -use data_encoding::BASE64; use tvix_castore::B3Digest; mod import; @@ -16,11 +15,11 @@ pub enum RenderError { #[error("unable to find directory {}, referred from {:?}", .0, .1)] DirectoryNotFound(B3Digest, bytes::Bytes), - #[error("unable to find blob {}, referred from {:?}", BASE64.encode(.0), .1)] - BlobNotFound([u8; 32], bytes::Bytes), + #[error("unable to find blob {}, referred from {:?}", .0, .1)] + BlobNotFound(B3Digest, bytes::Bytes), - #[error("unexpected size in metadata for blob {}, referred from {:?} returned, expected {}, got {}", BASE64.encode(.0), .1, .2, .3)] - UnexpectedBlobMeta([u8; 32], bytes::Bytes, u32, u32), + #[error("unexpected size in metadata for blob {}, referred from {:?} returned, expected {}, got {}", .0, .1, .2, .3)] + UnexpectedBlobMeta(B3Digest, bytes::Bytes, u32, u32), #[error("failure using the NAR writer: {0}")] NARWriterError(std::io::Error), -- cgit 1.4.1