From eacc023bfa55544804b6e56eb9bff528b914875a Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 27 Jul 2024 12:24:24 +0700 Subject: [PATCH] Use dep syntax for enabling optional dependencies. This prevents creating implicit features and also prevents these from showing up as features that can be enabled when using `cargo add criterion`. --- Cargo.toml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 42a3f87b..9947ff30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,15 +75,21 @@ default = ["rayon", "plotters", "cargo_bench_support"] # This is a legacy feature that no longer does anything, but removing it would be a semver break. real_blackbox = [] +# Enable rayon support +rayon = ["dep:rayon"] + +# Enable plotters support +plotters = ["dep:plotters"] + # Enable async/await support async = [] # These features enable built-in support for running async benchmarks on each different async # runtime. -async_futures = ["futures/executor", "async"] -async_smol = ["smol", "async"] -async_tokio = ["tokio", "async"] -async_std = ["async-std", "async"] +async_futures = ["dep:futures", "futures/executor", "async"] +async_smol = ["dep:smol", "async"] +async_tokio = ["dep:tokio", "async"] +async_std = ["dep:async-std", "async"] # This feature _currently_ does nothing except disable a warning message, but in 0.4.0 it will be # required in order to have Criterion.rs generate its own plots (as opposed to using cargo-criterion) @@ -96,7 +102,7 @@ cargo_bench_support = [] # This feature _currently_ does nothing, but in 0.4.0 it will be # required in order to have Criterion.rs generate CSV files. This feature is deprecated in favor of # cargo-criterion's --message-format=json option. -csv_output = ["csv"] +csv_output = ["dep:csv"] [workspace] exclude = ["cargo-criterion"]