about summary refs log tree commit diff
path: root/tvix/store/src/fuse/inodes.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-07-20T10·37+0300
committerclbot <clbot@tvl.fyi>2023-07-21T19·01+0000
commita6580748aabe7fcbea735396ac700661b6c53e87 (patch)
treefab2df50c860f6ddc6730693223aa42e0416dca0 /tvix/store/src/fuse/inodes.rs
parent72e82ffcb11b1aaf1f1cc8db4189ced5ec0aa42e (diff)
feat(tvix/store/digests): use bytes::Bytes instead of Vec<u8> r/6437
This will save us some copies, because a clone will simply create an
additional pointer to the same data.

Change-Id: I017a5d6b4c85a861b5541ebad2858ad4fbf8e8fa
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8978
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/fuse/inodes.rs')
-rw-r--r--tvix/store/src/fuse/inodes.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/store/src/fuse/inodes.rs b/tvix/store/src/fuse/inodes.rs
index bf883cb22ff8..a52ba7989e80 100644
--- a/tvix/store/src/fuse/inodes.rs
+++ b/tvix/store/src/fuse/inodes.rs
@@ -38,7 +38,7 @@ impl From<&proto::SymlinkNode> for InodeData {
 impl From<&proto::FileNode> for InodeData {
     fn from(value: &proto::FileNode) -> Self {
         InodeData::Regular(
-            B3Digest::from_vec(value.digest.clone()).unwrap(),
+            value.digest.clone().try_into().unwrap(),
             value.size,
             value.executable,
         )
@@ -49,7 +49,7 @@ impl From<&proto::FileNode> for InodeData {
 impl From<&proto::DirectoryNode> for InodeData {
     fn from(value: &proto::DirectoryNode) -> Self {
         InodeData::Directory(DirectoryInodeData::Sparse(
-            B3Digest::from_vec(value.digest.clone()).unwrap(),
+            value.digest.clone().try_into().unwrap(),
             value.size,
         ))
     }