Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- **Breaking:** `compcol::lzma2::Encoder` is now a normal (stateful) struct
instead of the former permanently-`Unsupported` unit-struct stub, because the
working encoder buffers chunk state. As a result it **no longer implements
`Copy`** and can no longer be constructed via a unit-struct literal; construct
it through `Lzma2::encoder()` as with every other codec. It still derives
`Debug` + `Clone`. (No effect on the decoder or any other codec.)
- **lz5 (Lizard) Huffman sub-streams** stay `Unsupported`, now with a precise
rationale in the module docs: the Huff0 entropy stage selects X1/X2 from
`(regenSize, comprLen)` at runtime and there is no reference encoder or
Expand Down
5 changes: 5 additions & 0 deletions src/lzma2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ enum EncPhase {
/// (dict + props + state) at the chunk boundary, emitting a compressed chunk
/// (control `0xE0`) when that shrinks the data and an uncompressed chunk
/// (control `0x01`) otherwise.
///
/// Note: unlike the former permanently-`Unsupported` stub (a unit struct),
/// the working encoder buffers state, so it is a normal struct and is no
/// longer `Copy` — construct it via [`Lzma2::encoder()`](crate::Algorithm).
#[derive(Debug, Clone)]
pub struct Encoder {
phase: EncPhase,
/// Staged bytes for the current chunk (or end marker), drained to the
Expand Down
2 changes: 1 addition & 1 deletion src/lzma2_internal/lzma2_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const NIL: u32 = u32::MAX;
/// raise `nice_match` (the length at which the chain walk gives up and
/// accepts the current match). This is the same speed-vs-ratio knob that
/// xz-utils exposes — we just expose a small subset.
#[derive(Clone, Copy)]
#[derive(Debug, Clone, Copy)]
pub(crate) struct EncoderParams {
pub max_chain: usize,
pub nice_match: u32,
Expand Down
Loading