From a8e7f4eadbfe59dd97848588a097837e3adcb849 Mon Sep 17 00:00:00 2001 From: edef Date: Tue, 7 Nov 2023 12:09:37 +0000 Subject: fix(tvix/castore): B3Digest::{to_vec -> as_slice} Not a single call site actually makes use of the Vec. Change-Id: I6cf31073c9f443d1702a21937a0c3938c2c643b8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9988 Tested-by: BuildkiteCI Reviewed-by: flokli --- tvix/castore/src/directoryservice/sled.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix/castore/src/directoryservice') diff --git a/tvix/castore/src/directoryservice/sled.rs b/tvix/castore/src/directoryservice/sled.rs index 0dc5496803cb..041908f9f956 100644 --- a/tvix/castore/src/directoryservice/sled.rs +++ b/tvix/castore/src/directoryservice/sled.rs @@ -64,7 +64,7 @@ impl DirectoryService for SledDirectoryService { #[instrument(skip(self, digest), fields(directory.digest = %digest))] async fn get(&self, digest: &B3Digest) -> Result, Error> { - match self.db.get(digest.to_vec()) { + match self.db.get(digest.as_slice()) { // The directory was not found, return Ok(None) => Ok(None), @@ -114,7 +114,7 @@ impl DirectoryService for SledDirectoryService { ))); } // store it - let result = self.db.insert(digest.to_vec(), directory.encode_to_vec()); + let result = self.db.insert(digest.as_slice(), directory.encode_to_vec()); if let Err(e) = result { return Err(Error::StorageError(e.to_string())); } -- cgit 1.4.1