# HG changeset patch # User Raphaël Gomès # Date 2024-11-04 12:43:36 # Node ID f69a3f55fa9b8dc98dc28a7b97c7993834b54afe # Parent 7756494c5ecd3db3e8bdae1a7f5dc48106bfae3c rust-compression: move the `Send` bound to the `Compressor` trait All compressors should be `Send`, might as well make any future use easier. diff --git a/rust/hg-core/src/revlog/compression.rs b/rust/hg-core/src/revlog/compression.rs --- a/rust/hg-core/src/revlog/compression.rs +++ b/rust/hg-core/src/revlog/compression.rs @@ -141,7 +141,7 @@ impl Default for CompressionConfig { /// 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( diff --git a/rust/hg-core/src/revlog/inner_revlog.rs b/rust/hg-core/src/revlog/inner_revlog.rs --- a/rust/hg-core/src/revlog/inner_revlog.rs +++ b/rust/hg-core/src/revlog/inner_revlog.rs @@ -75,7 +75,7 @@ pub struct InnerRevlog { /// 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>, + compressor: Mutex>, } impl InnerRevlog {