refactor(tvix/store/blobsvc/sled): clippy

Change-Id: Icfea8ceb6b827a645c6f10efae741f6fa2114fad
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8590
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
Florian Klink 2023-05-18 19:51:54 +03:00 committed by flokli
parent 2e09e94aad
commit a0801ae220

View file

@ -86,13 +86,13 @@ impl io::Write for SledBlobWriter {
impl BlobWriter for SledBlobWriter {
fn close(self) -> Result<[u8; 32], Error> {
let digest = self.hasher.finalize();
self.db.insert(digest.as_bytes(), self.buf).map_err(|e| {
Error::StorageError(format!("unable to insert blob: {}", e.to_string()))
})?;
self.db
.insert(digest.as_bytes(), self.buf)
.map_err(|e| Error::StorageError(format!("unable to insert blob: {}", e)))?;
Ok(digest
digest
.to_owned()
.try_into()
.map_err(|_| Error::StorageError("invalid digest length in response".to_string()))?)
.map_err(|_| Error::StorageError("invalid digest length in response".to_string()))
}
}