about summary refs log tree commit diff
path: root/tvix/store/src/store_io.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/store/src/store_io.rs')
-rw-r--r--tvix/store/src/store_io.rs23
1 files changed, 11 insertions, 12 deletions
diff --git a/tvix/store/src/store_io.rs b/tvix/store/src/store_io.rs
index 701b52f667ac..19a809b6a1a7 100644
--- a/tvix/store/src/store_io.rs
+++ b/tvix/store/src/store_io.rs
@@ -216,8 +216,8 @@ impl EvalIO for TvixStoreIO {
                         ))
                     }
                     crate::proto::node::Node::File(file_node) => {
-                        let digest =
-                            B3Digest::from_vec(file_node.digest.clone()).map_err(|_e| {
+                        let digest: B3Digest =
+                            file_node.digest.clone().try_into().map_err(|_e| {
                                 error!(
                                     file_node = ?file_node,
                                     "invalid digest"
@@ -272,16 +272,15 @@ impl EvalIO for TvixStoreIO {
                 match node {
                     crate::proto::node::Node::Directory(directory_node) => {
                         // fetch the Directory itself.
-                        let digest =
-                            B3Digest::from_vec(directory_node.digest.clone()).map_err(|_e| {
-                                io::Error::new(
-                                    io::ErrorKind::InvalidData,
-                                    format!(
-                                        "invalid digest length in directory node: {:?}",
-                                        directory_node
-                                    ),
-                                )
-                            })?;
+                        let digest = directory_node.digest.clone().try_into().map_err(|_e| {
+                            io::Error::new(
+                                io::ErrorKind::InvalidData,
+                                format!(
+                                    "invalid digest length in directory node: {:?}",
+                                    directory_node
+                                ),
+                            )
+                        })?;
 
                         if let Some(directory) = self.directory_service.get(&digest)? {
                             let mut children: Vec<(Vec<u8>, FileType)> = Vec::new();