Skip to content

Commit 71d5b03

Browse files
committed
Release 0.6.0
1 parent f5f9d09 commit 71d5b03

File tree

6 files changed

+26
-33
lines changed

6 files changed

+26
-33
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,28 +63,27 @@ jobs:
6363
rustup target add wasm32-wasip2
6464
shell: bash
6565
if: matrix.build == 'wasm32'
66-
- name: Run cargo doc, deny warnings (bzip2-sys)
66+
- name: Run cargo doc, deny warnings (libbzip2-rs-sys)
6767
env:
6868
RUSTDOCFLAGS: "-D warnings"
6969
run: |
70-
cargo doc -p bzip2-sys --no-deps
7170
cargo doc -p bzip2 --no-deps
72-
- name: Run cargo doc, deny warnings (libbz2-rs-sys)
71+
- name: Run cargo doc, deny warnings (bzip2-sys)
7372
env:
7473
RUSTDOCFLAGS: "-Dwarnings"
75-
if: matrix.build != 'msrv'
76-
run: cargo doc -p bzip2 --no-deps --no-default-features --features libbz2-rs-sys
74+
run: |
75+
cargo doc -p bzip2-sys --no-deps
76+
cargo doc -p bzip2 --no-deps --no-default-features --features bzip2-sys
7777
- name: Configure wasm32 env vars
7878
run: |
7979
echo "CARGO_TARGET_WASM32_WASIP2_RUNNER=/home/runner/.wasmtime/bin/wasmtime" >> $GITHUB_ENV
8080
echo "CARGO_BUILD_TARGET=wasm32-wasip2" >> $GITHUB_ENV
8181
if: matrix.build == 'wasm32'
82-
- name: Run cargo test (bzip2-sys)
82+
- name: Run cargo test (libbzip2-rs-sys)
8383
run: cargo test
84+
- name: Run cargo test (bzip2-sys)
85+
run: cargo test --no-default-features --features bzip2-sys
8486
if: matrix.build != 'wasm32'
85-
- name: Run cargo test (libbzip2-rs-sys)
86-
run: cargo test --no-default-features --features libbz2-rs-sys
87-
if: matrix.build != 'msrv'
8887

8988
rustfmt:
9089
name: Rustfmt

Cargo.toml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
edition = "2021"
33
name = "bzip2"
4-
version = "0.5.2"
4+
version = "0.6.0"
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"
77
keywords = ["bzip", "encoding"]
@@ -13,7 +13,7 @@ Bindings to libbzip2 for bzip2 compression and decompression exposed as
1313
Reader/Writer streams.
1414
"""
1515
categories = ["compression", "api-bindings"]
16-
rust-version = "1.65.0" # MSRV
16+
rust-version = "1.82.0" # MSRV
1717
publish = true
1818

1919
[workspace]
@@ -22,10 +22,10 @@ publish = true
2222
bzip2-sys = { version = "0.1.13", path = "bzip2-sys", optional = true }
2323

2424
[dependencies.libbz2-rs-sys]
25-
version = "0.1.3"
25+
version = "0.2.1"
2626
# Don't enable the stdio feature for better portability.
2727
default-features = false
28-
features = ["rust-allocator", "semver-prefix"]
28+
features = ["rust-allocator"]
2929
optional = true
3030

3131
[dev-dependencies]
@@ -34,11 +34,9 @@ partial-io = { version = "0.5.4", features = ["quickcheck1"] }
3434
quickcheck = "1.0"
3535

3636
[features]
37-
default = ["dep:bzip2-sys"]
38-
# Use the pure rust `libbz2-rs-sys` instead of the C FFI bindings of `bzip2-sys`
39-
# The rust bzip2 implementation is always statically linked.
40-
libbz2-rs-sys = ["dep:libbz2-rs-sys", "bzip2-sys?/__disabled"]
37+
default = ["dep:libbz2-rs-sys"]
38+
# Use the C bzip2 implementation. This will try to find the bzip2 dynamic library on your system, or build it from source.
39+
bzip2-sys = ["dep:bzip2-sys"]
4140
# Always build `libbz2` from C source, and statically link it.
4241
# This flag is only meaningful when `bzip2-sys` is used,
43-
# and has no effect when `libbz2-rs-sys` is used as the bzip2 implementation.
4442
static = ["bzip2-sys?/static"]

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,24 @@
22

33
[Documentation](https://docs.rs/bzip2)
44

5-
A streaming compression/decompression library for rust with bindings to `libbz2`.
5+
A streaming bzip2 compression/decompression library for rust.
66

77
## Features
88

9-
By default, `bzip2-rs` attempts to use the system `libbz2`. When `libbz2` is not available, the library
10-
is built from source. A from source build requires a functional C toolchain for your target, and may not
11-
work for all targets (in particular webassembly).
12-
13-
*`libbz2-rs-sys`*
9+
*`bzip2-sys`*
1410

15-
Since version 0.5.0, this crate also supports using [libbz2-rs-sys](https://crates.io/crates/libbz2-rs-sys),
16-
a drop-in compatible rust implementation of `libbz2`. With this feature enabled, cross-compilation should work
17-
like any other rust code, and no C toolchain is needed to compile this crate or its dependencies.
11+
Attempt to use the system `libbz2`. When `libbz2` is not available, built from source.
12+
A from-source build requires a functional C toolchain for your target, and may not
13+
work for all targets (in particular webassembly).
1814

1915
```sh
20-
bzip2 = { version = "0.5.1", default-features = false, features = ["libbz2-rs-sys"] }
16+
bzip2 = { version = "0.5.1", default-features = false, features = ["bzip2-sys"] }
2117
```
2218
2319
*`static`*
2420
2521
Always build `libbz2` from C source, and statically link it. This flag is only meaningful when `bzip2-sys` is used,
26-
and has no effect when `libbz2-rs-sys` is used as the bzip2 implementation.
22+
and has no effect when the default `libbz2-rs-sys` is used as the bzip2 implementation.
2723
2824
## License
2925

bzip2-sys/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ macro_rules! abi_compat {
4848
$(pub fn $name($($arg: $t),*) -> $ret;)*
4949
}
5050
#[cfg(not(windows))]
51-
extern {
51+
extern "C" {
5252
$(pub fn $name($($arg: $t),*) -> $ret;)*
5353
}
5454
}

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
#![deny(missing_docs)]
5757
#![doc(html_root_url = "https://docs.rs/bzip2/")]
5858

59-
#[cfg(not(feature = "libbz2-rs-sys"))]
59+
#[cfg(feature = "bzip2-sys")]
6060
extern crate bzip2_sys as ffi;
61-
#[cfg(feature = "libbz2-rs-sys")]
61+
#[cfg(not(feature = "bzip2-sys"))]
6262
extern crate libbz2_rs_sys as ffi;
6363
#[cfg(test)]
6464
extern crate partial_io;

src/mem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ impl fmt::Display for Error {
305305

306306
impl From<Error> for std::io::Error {
307307
fn from(data: Error) -> std::io::Error {
308-
std::io::Error::new(std::io::ErrorKind::Other, data)
308+
std::io::Error::other(data)
309309
}
310310
}
311311

0 commit comments

Comments
 (0)