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
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,17 @@ fn main() {

## Backends

The default `miniz_oxide` backend has the advantage of being pure Rust. If you
want maximum performance, you can use the zlib-ng C library:
The default `miniz_oxide` backend has the advantage of being pure Rust.

If you want maximum performance while still benefiting from a pure rust
implementation, you can use `zlib-rs`:

```toml
[dependencies]
flate2 = { version = "1.0.17", features = ["zlib-rs"], default-features = false }
```

Or, you can use the zlib-ng C library:

```toml
[dependencies]
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
//! crate which is a port of `miniz.c` (below) to Rust. This feature does not
//! require a C compiler and only requires Rust code.
//!
//! * `zlib-rs` - this implementation utilizes the `zlib-rs` crate, a pure rust rewrite of zlib.
//! This backend is faster than both `rust_backend` and `zlib`. However, we did not set it as the
//! default choice to prevent compatibility issues.
//!
//! * `zlib` - this feature will enable linking against the `libz` library, typically found on most
//! Linux systems by default. If the library isn't found to already be on the system it will be
//! compiled from source (this is a C library).
Expand Down