Skip to content

Commit 9428b70

Browse files
authored
Merge pull request #470 from Xuanwo/update-readme-for-zlib-rs
docs: Update README to promote zlib-rs
2 parents 70de9df + e6aed50 commit 9428b70

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,17 @@ fn main() {
6767

6868
## Backends
6969

70-
The default `miniz_oxide` backend has the advantage of being pure Rust. If you
71-
want maximum performance, you can use the zlib-ng C library:
70+
The default `miniz_oxide` backend has the advantage of being pure Rust.
71+
72+
If you want maximum performance while still benefiting from a pure rust
73+
implementation, you can use `zlib-rs`:
74+
75+
```toml
76+
[dependencies]
77+
flate2 = { version = "1.0.17", features = ["zlib-rs"], default-features = false }
78+
```
79+
80+
Or, you can use the zlib-ng C library:
7281

7382
```toml
7483
[dependencies]

src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
//! crate which is a port of `miniz.c` (below) to Rust. This feature does not
2121
//! require a C compiler and only requires Rust code.
2222
//!
23+
//! * `zlib-rs` - this implementation utilizes the `zlib-rs` crate, a pure rust rewrite of zlib.
24+
//! This backend is faster than both `rust_backend` and `zlib`. However, we did not set it as the
25+
//! default choice to prevent compatibility issues.
26+
//!
2327
//! * `zlib` - this feature will enable linking against the `libz` library, typically found on most
2428
//! Linux systems by default. If the library isn't found to already be on the system it will be
2529
//! compiled from source (this is a C library).

0 commit comments

Comments
 (0)