diff options
Diffstat (limited to 'tvix/store/src/blobservice')
-rw-r--r-- | tvix/store/src/blobservice/grpc.rs | 10 | ||||
-rw-r--r-- | tvix/store/src/blobservice/memory.rs | 4 | ||||
-rw-r--r-- | tvix/store/src/blobservice/mod.rs | 3 | ||||
-rw-r--r-- | tvix/store/src/blobservice/sled.rs | 4 |
4 files changed, 10 insertions, 11 deletions
diff --git a/tvix/store/src/blobservice/grpc.rs b/tvix/store/src/blobservice/grpc.rs index 46ec64bce785..6f04c6a3d4b6 100644 --- a/tvix/store/src/blobservice/grpc.rs +++ b/tvix/store/src/blobservice/grpc.rs @@ -121,9 +121,9 @@ impl BlobService for GRPCBlobService { } } - /// Returns a [Self::BlobWriter], that'll internally wrap each write in a - // [proto::BlobChunk] and which is passed to the - fn open_write(&self) -> Result<Box<dyn BlobWriter>, crate::Error> { + /// Returns a BlobWriter, that'll internally wrap each write in a + // [proto::BlobChunk], which is send to the gRPC server. + fn open_write(&self) -> Box<dyn BlobWriter> { let mut grpc_client = self.grpc_client.clone(); // set up an mpsc channel passing around Bytes. @@ -155,11 +155,11 @@ impl BlobService for GRPCBlobService { // … which is then turned into a [io::Write]. let writer = SyncIoBridge::new(async_writer); - Ok(Box::new(GRPCBlobWriter { + Box::new(GRPCBlobWriter { tokio_handle: self.tokio_handle.clone(), // TODO: is the clone() ok here? task_and_writer: Some((task, writer)), digest: None, - })) + }) } } diff --git a/tvix/store/src/blobservice/memory.rs b/tvix/store/src/blobservice/memory.rs index 166eeabdb6a2..0ea8479f87e5 100644 --- a/tvix/store/src/blobservice/memory.rs +++ b/tvix/store/src/blobservice/memory.rs @@ -30,8 +30,8 @@ impl BlobService for MemoryBlobService { } #[instrument(skip(self))] - fn open_write(&self) -> Result<Box<dyn BlobWriter>, Error> { - Ok(Box::new(MemoryBlobWriter::new(self.db.clone()))) + fn open_write(&self) -> Box<dyn BlobWriter> { + Box::new(MemoryBlobWriter::new(self.db.clone())) } } diff --git a/tvix/store/src/blobservice/mod.rs b/tvix/store/src/blobservice/mod.rs index d9aa15bf2a46..c1bca927d7d0 100644 --- a/tvix/store/src/blobservice/mod.rs +++ b/tvix/store/src/blobservice/mod.rs @@ -24,8 +24,7 @@ pub trait BlobService: Send + Sync { /// Insert a new blob into the store. Returns a [BlobWriter], which /// implements [io::Write] and a [BlobWriter::close]. - /// TODO: is there any reason we want this to be a Result<>, and not just T? - fn open_write(&self) -> Result<Box<dyn BlobWriter>, Error>; + fn open_write(&self) -> Box<dyn BlobWriter>; } /// A [io::Write] that you need to close() afterwards, and get back the digest diff --git a/tvix/store/src/blobservice/sled.rs b/tvix/store/src/blobservice/sled.rs index 3f212142b9d1..1ae71170e1e4 100644 --- a/tvix/store/src/blobservice/sled.rs +++ b/tvix/store/src/blobservice/sled.rs @@ -46,8 +46,8 @@ impl BlobService for SledBlobService { } #[instrument(skip(self))] - fn open_write(&self) -> Result<Box<dyn BlobWriter>, Error> { - Ok(Box::new(SledBlobWriter::new(self.db.clone()))) + fn open_write(&self) -> Box<dyn BlobWriter> { + Box::new(SledBlobWriter::new(self.db.clone())) } } |