Skip to content

Commit

Permalink
build!(gateway, http, lavalink): Rename native feature to native-tls
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Reidel <[email protected]>
  • Loading branch information
Gelbpunkt committed Jan 14, 2024
1 parent f875e7f commit df05766
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion twilight-gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tracing-subscriber = { default-features = false, features = ["fmt", "tracing-log

[features]
default = ["rustls-native-roots", "twilight-http", "zlib-stock"]
native = ["tokio-websockets/native-tls", "tokio-websockets/openssl"]
native-tls = ["tokio-websockets/native-tls", "tokio-websockets/openssl"]
rustls-native-roots = ["tokio-websockets/ring", "tokio-websockets/rustls-native-roots"]
rustls-webpki-roots = ["tokio-websockets/ring", "tokio-websockets/rustls-webpki-roots"]
zlib-simd = ["dep:flate2", "flate2?/zlib-ng"]
Expand Down
2 changes: 1 addition & 1 deletion twilight-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Using the `stream` module, shards can be easily managed in groups.
* `simd-json`: use [`simd-json`] instead of [`serde_json`] for deserializing
events
* TLS (mutually exclusive)
* `native`: platform's native TLS implementation via [`native-tls`]
* `native-tls`: platform's native TLS implementation via [`native-tls`]
* `rustls-native-roots` (*default*): [`rustls`] using native root certificates
* `rustls-webpki-roots`: [`rustls`] using [`webpki-roots`] for root
certificates, useful for `scratch` containers
Expand Down
4 changes: 2 additions & 2 deletions twilight-gateway/src/shard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ use crate::{
use futures_util::{stream::Stream, SinkExt};
use serde::{de::DeserializeOwned, Deserialize};
#[cfg(any(
feature = "native",
feature = "native-tls",
feature = "rustls-native-roots",
feature = "rustls-webpki-roots"
))]
Expand Down Expand Up @@ -968,7 +968,7 @@ impl<Q: Queue> Shard<Q> {
// connection is considered unusable after encountering an io
// error, returning `None`.
#[cfg(any(
feature = "native",
feature = "native-tls",
feature = "rustls-native-roots",
feature = "rustls-webpki-roots"
))]
Expand Down
2 changes: 1 addition & 1 deletion twilight-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ simd-json = { default-features = false, features = ["serde_impl", "swar-number-p
[features]
default = ["decompression", "rustls-native-roots"]
decompression = ["dep:brotli"]
native = ["dep:hyper-tls"]
native-tls = ["dep:hyper-tls"]
rustls-native-roots = ["dep:hyper-rustls", "hyper-rustls?/native-tokio"]
rustls-webpki-roots = ["dep:hyper-rustls", "hyper-rustls?/webpki-tokio"]
hickory = ["dep:hyper-hickory"]
Expand Down
6 changes: 3 additions & 3 deletions twilight-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ Discord's API is HTTPS only.
`twilight-http` has features to enable HTTPS connectivity with [`hyper`]. These
features are mutually exclusive. `rustls-native-roots` is enabled by default.

#### `native`
#### `native-tls`

The `native` feature uses a HTTPS connector provided by [`hyper-tls`].
The `native-tls` feature uses a HTTPS connector provided by [`hyper-tls`].

To enable `native`, do something like this in your `Cargo.toml`:
To enable `native-tls`, do something like this in your `Cargo.toml`:

```toml
[dependencies]
Expand Down
8 changes: 4 additions & 4 deletions twilight-http/src/client/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
type HttpsConnector<T> = hyper_rustls::HttpsConnector<T>;
/// HTTPS connector using `hyper-tls` as a TLS backend.
#[cfg(all(
feature = "native",
feature = "native-tls",
not(any(feature = "rustls-native-roots", feature = "rustls-webpki-roots"))
))]
type HttpsConnector<T> = hyper_tls::HttpsConnector<T>;
Expand All @@ -19,14 +19,14 @@ type HttpConnector = hyper_util::client::legacy::connect::HttpConnector;

/// Re-exported generic connector for use in the client.
#[cfg(any(
feature = "native",
feature = "native-tls",
feature = "rustls-native-roots",
feature = "rustls-webpki-roots"
))]
pub type Connector = HttpsConnector<HttpConnector>;
/// Re-exported generic connector for use in the client.
#[cfg(not(any(
feature = "native",
feature = "native-tls",
feature = "rustls-native-roots",
feature = "rustls-webpki-roots"
)))]
Expand Down Expand Up @@ -57,7 +57,7 @@ pub fn create() -> Connector {
.enable_http2()
.wrap_connector(connector);
#[cfg(all(
feature = "native",
feature = "native-tls",
not(feature = "rustls-native-roots"),
not(feature = "rustls-webpki-roots")
))]
Expand Down
2 changes: 1 addition & 1 deletion twilight-lavalink/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ twilight-http = { default-features = false, features = ["rustls-native-roots"],
[features]
default = ["http-support", "rustls-native-roots"]
http-support = ["dep:percent-encoding"]
native = ["tokio-websockets/native-tls", "tokio-websockets/openssl"]
native-tls = ["tokio-websockets/native-tls", "tokio-websockets/openssl"]
rustls-native-roots = ["tokio-websockets/ring", "tokio-websockets/rustls-native-roots"]
rustls-webpki-roots = ["tokio-websockets/ring", "tokio-websockets/rustls-webpki-roots"]

Expand Down
8 changes: 4 additions & 4 deletions twilight-lavalink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ request types from the [`http`] crate. This is enabled by default.
features. These features are mutually exclusive. `rustls-native-roots` is enabled by
default.

#### `native`
#### `native-tls`

The `native` feature enables [`tokio-websockets`]' `native-tls` feature.
The `native-tls` feature enables [`tokio-websockets`]' `native-tls` feature.

To enable `native`, do something like this in your `Cargo.toml`:
To enable `native-tls`, do something like this in your `Cargo.toml`:

```toml
[dependencies]
twilight-lavalink = { default-features = false, features = ["native"], version = "0.2" }
twilight-lavalink = { default-features = false, features = ["native-tls"], version = "0.2" }
```

#### `rustls-native-roots`
Expand Down

0 comments on commit df05766

Please sign in to comment.