Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix feature name casing #2051

Merged
merged 4 commits into from Jul 19, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions Cargo.toml
Expand Up @@ -179,7 +179,7 @@ gateway = ["flate2", "http", "utils"]
http = []
absolute_ratelimits = ["http"]
model = ["builder", "http"]
voice-model = ["serenity-voice-model"]
voice_model = ["serenity-voice-model"]
standard_framework = ["framework", "uwl", "levenshtein", "command_attr", "static_assertions"]
unstable_discord_api = []
utils = ["base64"]
Expand All @@ -188,7 +188,7 @@ tokio_task_builder = ["tokio/tracing"]
time = []

# Enables simd accelerated parsing
simdjson = ["simd-json"]
simd_json = ["simd-json"]

# Enables temporary caching in functions that retrieve data via the HTTP API.
temp_cache = ["cache", "moka"]
Expand All @@ -210,6 +210,10 @@ native_tls_backend = [
"bytes",
]

# TODO(next): Remove, these are deprecated aliases
simdjson = ["simd_json"]
voice-model = ["voice_model"]

[package.metadata.docs.rs]
features = ["default", "collector", "unstable_discord_api", "voice", "voice-model"]
rustdoc-args = ["--cfg", "docsrs"]
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -153,7 +153,7 @@ due to latency in the network. If you turn this feature on, it is recommended to
synchronise your clock with an NTP server (such as Google's).
- **tokio_task_builder**: Enables tokio's `tracing` feature and uses `tokio::task::Builder` to spawn tasks with names if `RUSTFLAGS="--cfg tokio_unstable"` is set.
- **unstable_discord_api**: Enables features of the Discord API that do not have a stable interface. The features might not have official documentation or are subject to change.
- **simdjson**: Enables SIMD accelerated JSON parsing and rendering for API calls, use with `RUSTFLAGS="-C target-cpu=native"`
- **simd_json**: Enables SIMD accelerated JSON parsing and rendering for API calls, use with `RUSTFLAGS="-C target-cpu=native"`
- **temp_cache**: Enables temporary caching in functions that retrieve data via the HTTP API.

Serenity offers two TLS-backends, `rustls_backend` by default, you need to pick
Expand Down
17 changes: 16 additions & 1 deletion build.rs
Expand Up @@ -12,4 +12,19 @@ compile_error!(
If you are unsure, go with `rustls_backend`."
);

fn main() {}
#[cfg_attr(
feature = "simdjson",
deprecated = "The `simdjson` feature name is deprecated and will be removed in the next version of serenity, use `simd_json`."
)]
fn deprecated_simd_json_feature() {}

#[cfg_attr(
feature = "voice-model",
deprecated = "The `voice-model` feature name is deprecated and will be removed in the next version of serenity, use `voice_model`."
)]
fn deprecated_voice_model_feature() {}

fn main() {
deprecated_simd_json_feature();
deprecated_voice_model_feature()
}