From eeaa2c212b7150648d2c629c8fe3280c73e269a5 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 18 Jun 2020 13:55:28 +0200 Subject: [PATCH] impl Sync for DataBlobReader this is safe for the reason explained in the comment Signed-off-by: Dominik Csapak --- src/backup/data_blob_reader.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backup/data_blob_reader.rs b/src/backup/data_blob_reader.rs index 62caa5ce..d6fc7865 100644 --- a/src/backup/data_blob_reader.rs +++ b/src/backup/data_blob_reader.rs @@ -19,6 +19,10 @@ pub struct DataBlobReader { state: BlobReaderState, } +// zstd_safe::DCtx is not sync but we are, since +// the only public interface is on mutable reference +unsafe impl Sync for DataBlobReader {} + impl DataBlobReader { pub fn new(mut reader: R, config: Option>) -> Result {