changeset 52309:f69a3f55fa9b

rust-compression: move the `Send` bound to the `Compressor` trait All compressors should be `Send`, might as well make any future use easier.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 04 Nov 2024 13:43:36 +0100
parents 7756494c5ecd
children a876ab6c3fd5
files rust/hg-core/src/revlog/compression.rs rust/hg-core/src/revlog/inner_revlog.rs
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/compression.rs	Mon Nov 04 12:10:22 2024 +0100
+++ b/rust/hg-core/src/revlog/compression.rs	Mon Nov 04 13:43:36 2024 +0100
@@ -141,7 +141,7 @@
 
 /// A high-level trait to define compressors that should be able to compress
 /// and decompress arbitrary bytes.
-pub trait Compressor {
+pub trait Compressor: Send {
     /// Returns a new [`Vec`] with the compressed data.
     /// Should return `Ok(None)` if compression does not apply (e.g. too small)
     fn compress(
--- a/rust/hg-core/src/revlog/inner_revlog.rs	Mon Nov 04 12:10:22 2024 +0100
+++ b/rust/hg-core/src/revlog/inner_revlog.rs	Mon Nov 04 13:43:36 2024 +0100
@@ -75,7 +75,7 @@
     /// The [`Compressor`] that this revlog uses by default to compress data.
     /// This does not mean that this revlog uses this compressor for reading
     /// data, as different revisions may have different compression modes.
-    compressor: Mutex<Box<dyn Compressor + Send>>,
+    compressor: Mutex<Box<dyn Compressor>>,
 }
 
 impl InnerRevlog {