Skip to content

Commit

Permalink
Release 0.3.3 (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
fintelia authored Dec 26, 2023
1 parent 361842d commit 160b008
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
5 changes: 4 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Changelog

## 0.3.3

- Add `decompress_to_vec_bounded` method.

## 0.3.2

- Allow decoding into buffers without extra space.
- Add `decompress_to_vec_bounded` method.

## 0.3.1

Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fdeflate"
version = "0.3.2"
version = "0.3.3"
edition = "2021"

# note: when changed, also update test runner in `.github/workflows/rust.yml`
Expand All @@ -9,6 +9,7 @@ rust-version = "1.57.0"
license = "MIT OR Apache-2.0"
description = "Fast specialized deflate implementation"
authors = ["The image-rs Developers"]
include = ["/src", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]

# crates.io metadata
documentation = "https://docs.rs/fdeflate"
Expand Down
13 changes: 9 additions & 4 deletions src/decompress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1015,14 +1015,19 @@ pub fn decompress_to_vec(input: &[u8]) -> Result<Vec<u8>, DecompressionError> {
}
}

// An error encountered while decompressing a deflate stream given a bounded
// maximum output.
/// An error encountered while decompressing a deflate stream given a bounded maximum output.
pub enum BoundedDecompressionError {
/// The input is not a valid deflate stream.
DecompressionError { inner: DecompressionError },
DecompressionError {
/// The underlying error.
inner: DecompressionError,
},

/// The output is too large.
OutputTooLarge { partial_output: Vec<u8> },
OutputTooLarge {
/// The output decoded so far.
partial_output: Vec<u8>,
},
}
impl From<DecompressionError> for BoundedDecompressionError {
fn from(inner: DecompressionError) -> Self {
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ mod decompress;
mod tables;

pub use compress::{compress_to_vec, Compressor, StoredOnlyCompressor};
pub use decompress::{decompress_to_vec, DecompressionError, Decompressor};
pub use decompress::{
decompress_to_vec, decompress_to_vec_bounded, BoundedDecompressionError, DecompressionError,
Decompressor,
};

/// Build a length limited huffman tree.
///
Expand Down

0 comments on commit 160b008

Please sign in to comment.