From 23ddf49229f507b1a06cfa13d1c0d828b63ce919 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 17 Mar 2023 00:20:31 +0100 Subject: chore(tvix/store/chunkservice): clippy lint Change-Id: I2073408fe6e87ffadbeb35ef2f9aaa0316c54966 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8319 Tested-by: BuildkiteCI Reviewed-by: tazjin Autosubmit: flokli --- tvix/store/src/chunkservice/memory.rs | 4 ++-- tvix/store/src/chunkservice/sled.rs | 4 ++-- tvix/store/src/chunkservice/util.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tvix') diff --git a/tvix/store/src/chunkservice/memory.rs b/tvix/store/src/chunkservice/memory.rs index 55e646ea7714..9fe4dc17d5ec 100644 --- a/tvix/store/src/chunkservice/memory.rs +++ b/tvix/store/src/chunkservice/memory.rs @@ -46,8 +46,8 @@ impl ChunkService for MemoryChunkService { let digest = blake3::hash(&data); let mut db = self.db.write().unwrap(); - db.insert(digest.as_bytes().clone(), data); + db.insert(*digest.as_bytes(), data); - Ok(digest.as_bytes().clone()) + Ok(*digest.as_bytes()) } } diff --git a/tvix/store/src/chunkservice/sled.rs b/tvix/store/src/chunkservice/sled.rs index 43c98813a240..8e86e1825b28 100644 --- a/tvix/store/src/chunkservice/sled.rs +++ b/tvix/store/src/chunkservice/sled.rs @@ -61,10 +61,10 @@ impl ChunkService for SledChunkService { #[instrument(name = "SledChunkService::put", skip(self, data))] fn put(&self, data: Vec) -> Result<[u8; 32], Error> { let digest = blake3::hash(&data); - let result = self.db.insert(&digest.as_bytes(), data); + let result = self.db.insert(digest.as_bytes(), data); if let Err(e) = result { return Err(Error::StorageError(e.to_string())); } - Ok(digest.as_bytes().clone()) + Ok(*digest.as_bytes()) } } diff --git a/tvix/store/src/chunkservice/util.rs b/tvix/store/src/chunkservice/util.rs index 1121a791fc94..2ad663733b04 100644 --- a/tvix/store/src/chunkservice/util.rs +++ b/tvix/store/src/chunkservice/util.rs @@ -21,7 +21,7 @@ pub fn upload_chunk( assert_eq!(&digest_resp, digest.as_bytes()); - Ok(digest.as_bytes().clone()) + Ok(*digest.as_bytes()) } /// reads through a reader, writes chunks to a [ChunkService] and returns a -- cgit 1.4.1