Skip to content

Commit

Permalink
enhancement!(gateway): rename zlib features (#829)
Browse files Browse the repository at this point in the history
Rename the two zlib features - `stock-zlib` and `simd-zlib` - for
consistency with other feature flags. These have been renamed to
`zlib-stock` and `zlib-simd` to properly namespace the feature flags.

Closes #717.

BREAKING CHANGES: The gateway's `stock-zlib` and `simd-zlib` feature
flags have been renamed to `zlib-stock` and `zlib-simd`, respectively.
  • Loading branch information
zeylahellyer authored and 7596ff committed Jun 13, 2021
1 parent 8f47868 commit af58b94
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ jobs:
rustflags: '-C target-cpu=native'
- package: gateway
features: rustls
additional: --features stock-zlib
additional: --features zlib-stock
- package: gateway
features: native
additional: --features stock-zlib
additional: --features zlib-stock
- package: gateway
features: simd-json
additional: --features rustls,stock-zlib
additional: --features rustls,zlib-stock
rustflags: '-C target-cpu=native'
- package: lavalink
additional: --features http-support
Expand Down
4 changes: 2 additions & 2 deletions gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ native = ["twilight-http/native", "twilight-gateway-queue/native", "tokio-tungst
rustls = ["rustls-native-roots"]
rustls-native-roots = ["twilight-http/rustls-native-roots", "twilight-gateway-queue/rustls-native-roots", "tokio-tungstenite/rustls-tls"]
rustls-webpki-roots = ["twilight-http/rustls-webpki-roots", "twilight-gateway-queue/rustls-webpki-roots", "tokio-tungstenite/rustls-tls"]
simd-zlib = ["compression", "flate2/zlib-ng-compat"]
zlib-simd = ["compression", "flate2/zlib-ng-compat"]
# if the `zlib` feature is enabled anywhere in the dependency tree it will
# always use stock zlib instead of zlib-ng.
# https://github.com/rust-lang/libz-sys/blob/main/README.md#zlib-ng
stock-zlib = ["compression", "flate2/zlib"]
zlib-stock = ["compression", "flate2/zlib"]
8 changes: 4 additions & 4 deletions gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ zlib is enabled with the feature `compression` and one of the two `zlib` feature
described below. Enabling any of the two features below will also enable
`compression`. `compression` is enabled by default.

There are 2 zlib features `stock-zlib` and `simd-zlib` for the library to work
one of them has to be enabled. If both are enabled it will use `stock-zlib`
There are 2 zlib features `zlib-stock` and `zlib-simd` for the library to work
one of them has to be enabled. If both are enabled it will use `zlib-stock`

`stock-zlib` enabled by default.
`zlib-stock` enabled by default.

Enabling **only** `simd-zlib` will make the library use [`zlib-ng`] which is a modern
Enabling **only** `zlib-simd` will make the library use [`zlib-ng`] which is a modern
fork of zlib that is faster and more effective, but it needs `cmake` to compile.

### Metrics
Expand Down
8 changes: 4 additions & 4 deletions gateway/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@
//! described below. Enabling any of the two features below will also enable
//! `compression`. `compression` is enabled by default.
//!
//! There are 2 zlib features `stock-zlib` and `simd-zlib` for the library to work
//! one of them has to be enabled. If both are enabled it will use `stock-zlib`
//! There are 2 zlib features `zlib-stock` and `zlib-simd` for the library to work
//! one of them has to be enabled. If both are enabled it will use `zlib-stock`
//!
//! `stock-zlib` enabled by default.
//! `zlib-stock` enabled by default.
//!
//! Enabling **only** `simd-zlib` will make the library use [`zlib-ng`] which is a modern
//! Enabling **only** `zlib-simd` will make the library use [`zlib-ng`] which is a modern
//! fork of zlib that is faster and more effective, but it needs `cmake` to compile.
//!
//! ### Metrics
Expand Down

0 comments on commit af58b94

Please sign in to comment.