From 878b2d8920050b24fc532e7c0d178e60a11fd76b Mon Sep 17 00:00:00 2001 From: Michael Krasnitski Date: Thu, 28 Nov 2024 15:11:23 -0500 Subject: [PATCH] Adjust Cargo.toml --- Cargo.toml | 31 ++++++++----------------------- src/lib.rs | 2 +- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 769ae37cb09..4c3ac6fe676 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,6 @@ rust-version = "1.82" [dependencies] # Required dependencies -bitflags = "2.4.2" serde_json = "1.0.108" async-trait = "0.1.74" tracing = { version = "0.1.40", features = ["log"] } @@ -36,36 +35,22 @@ serde = { version = "1.0.192", features = ["derive", "rc"] } url = { version = "2.4.1", features = ["serde"] } tokio = { version = "1.34.0", features = ["macros", "rt", "sync", "time", "io-util"] } futures = { version = "0.3.29", default-features = false, features = ["std"] } -dep_time = { version = "0.3.36", package = "time", features = ["formatting", "parsing", "serde-well-known"] } -base64 = { version = "0.22.0" } -zeroize = { version = "1.7" } # Not used in serenity, but bumps the minimal version from secrecy -arrayvec = { version = "0.7.4", features = ["serde"] } -serde_cow = { version = "0.1.0" } small-fixed-array = { version = "0.4", features = ["serde"] } -bool_to_bitflags = { version = "0.1.2" } -nonmax = { version = "0.5.5", features = ["serde"] } strum = { version = "0.26", features = ["derive"] } to-arraystring = "0.2.0" extract_map = { version = "0.1.0", features = ["serde", "iter_mut"] } aformat = "0.1.3" -bytes = "1.5.0" # Optional dependencies -fxhash = { version = "0.2.1", optional = true } -chrono = { version = "0.4.31", default-features = false, features = ["clock", "serde"], optional = true } flate2 = { version = "1.0.28", optional = true } zstd-safe = { version = "7.2.1", optional = true } reqwest = { version = "0.12.2", default-features = false, features = ["multipart", "stream", "json"], optional = true } tokio-tungstenite = { version = "0.24.0", features = ["url"], optional = true } -percent-encoding = { version = "2.3.0", optional = true } mini-moka = { version = "0.10.2", optional = true } -mime_guess = { version = "2.0.4", optional = true } -dashmap = { version = "6.1.0", features = ["serde"], optional = true } parking_lot = { version = "0.12.1"} ed25519-dalek = { version = "2.0.0", optional = true } typesize = { version = "0.1.6", optional = true, features = ["url", "time", "serde_json", "secrecy", "parking_lot", "nonmax", "extract_map_01"] } # serde feature only allows for serialisation, # Serenity workspace crates -serenity-voice-model = { version = "0.2.0", path = "./voice-model", optional = true } serenity-core = { path = "./serenity-core" } [dev-dependencies.http_crate] @@ -88,10 +73,10 @@ default_no_backend = [ # Enables builder structs to configure Discord HTTP requests. Without this feature, you have to # construct JSON manually at some places. -builder = ["tokio/fs"] +builder = ["serenity-core/builder"] # Enables the cache, which stores the data received from Discord gateway to provide access to # complete guild data, channels, users and more without needing HTTP requests. -cache = ["fxhash", "dashmap"] +cache = ["serenity-core/cache"] # Enables collectors, a utility feature that lets you await interaction events in code with # zero setup, without needing to setup an InteractionCreate event listener. collector = ["gateway"] @@ -100,13 +85,13 @@ framework = ["gateway"] # Enables gateway support, which allows bots to listen for Discord events. gateway = ["model", "flate2"] # Enables HTTP, which enables bots to execute actions on Discord. -http = ["dashmap", "mime_guess", "percent-encoding"] +http = ["serenity-core/http"] # Enables wrapper methods around HTTP requests on model types. # Requires "builder" to configure the requests and "http" to execute them. # Note: the model type definitions themselves are always active, regardless of this feature. # TODO: remove dependeny on utils feature -model = ["builder", "http", "utils"] -voice_model = ["serenity-voice-model"] +model = ["serenity-core/model", "builder", "http", "utils"] +voice_model = ["serenity-core/voice_model"] # Enables zlib-stream transport compression of incoming gateway events. transport_compression_zlib = ["flate2", "gateway"] # Enables zstd-stream transport compression of incoming gateway events. @@ -115,13 +100,13 @@ transport_compression_zstd = ["zstd-safe", "gateway"] # are allowed to change even in semver non-breaking updates. unstable = [] # Enables some utility functions that can be useful for bot creators. -utils = [] +utils = ["serenity-core/utils"] voice = ["gateway"] # Enables unstable tokio features to give explicit names to internally spawned tokio tasks tokio_task_builder = ["tokio/tracing"] interactions_endpoint = ["ed25519-dalek"] # Uses chrono for Timestamp, instead of time -chrono = ["dep:chrono", "typesize?/chrono"] +chrono = ["serenity-core/chrono"] # This enables all parts of the serenity codebase # (Note: all feature-gated APIs to be documented should have their features listed here!) @@ -132,7 +117,7 @@ full = ["default", "collector", "voice", "voice_model", "interactions_endpoint"] # Enables temporary caching in functions that retrieve data via the HTTP API. temp_cache = ["cache", "mini-moka", "typesize?/mini_moka"] -typesize = ["dep:typesize", "serenity-core/typesize", "dashmap/typesize", "small-fixed-array/typesize", "bool_to_bitflags/typesize"] +typesize = ["dep:typesize", "serenity-core/typesize"] # Enables compile-time heavy instrument macros from tracing tracing_instrument = ["tracing/attributes"] diff --git a/src/lib.rs b/src/lib.rs index 111fe74df2a..1de2ddba0b6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -158,4 +158,4 @@ pub mod all { // Re-exports of crates used internally which are already publically exposed. pub use async_trait::async_trait; -pub use {futures, nonmax, small_fixed_array}; +pub use futures;