Skip to content
Open
64 changes: 28 additions & 36 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "topgg"
version = "2.0.0"
edition = "2021"
edition = "2024"
rust-version = "1.87"
authors = ["null (https://github.com/null8626)", "Top.gg <support@top.gg> (https://top.gg)"]
description = "A simple API wrapper for Top.gg written in Rust."
description = "The community-maintained Rust library for Top.gg."
readme = "README.md"
repository = "https://github.com/Top-gg-Community/rust-sdk"
license = "MIT"
Expand All @@ -12,21 +13,23 @@ categories = ["api-bindings", "web-programming::http-client"]
exclude = [".gitattributes", ".github/", ".gitignore", "rustfmt.toml"]

[dependencies]
base64 = { version = "0.22", optional = true }
cfg-if = "1"
paste = { version = "1", optional = true }
reqwest = { version = "0.12", optional = true }
serde = { version = "1", features = ["derive"] }
tokio = { version = "1", features = ["rt", "sync", "time"], optional = true }
urlencoding = "2"
urlencoding = { version = "2", optional = true }
bytes = { version = "1.11", optional = true }
hex = { version = "0.4", optional = true }
sha2 = { version = "0.10", optional = true }
hmac = { version = "0.12", optional = true }
futures-core = { version = "0.3", optional = true }

serenity = { version = "0.12", features = ["builder", "client", "gateway", "model", "utils"], optional = true }

twilight-http = { version = "0.15", optional = true }
twilight-model = { version = "0.15", optional = true }
twilight-cache-inmemory = { version = "0.15", optional = true }

chrono = { version = "0.4", default-features = false, optional = true, features = ["serde", "now"] }
chrono = { version = "0.4", default-features = false, features = ["serde", "now"] }
serde_json = { version = "1", optional = true }

rocket = { version = "0.5", default-features = false, features = ["json"], optional = true }
Expand All @@ -39,42 +42,31 @@ actix-web = { version = "4", default-features = false, optional = true }
tokio = { version = "1", features = ["rt", "macros"] }
twilight-gateway = "0.15"

[lints.clippy]
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
cast-lossless = "allow"
cast-possible-truncation = "allow"
cast-possible-wrap = "allow"
cast-sign-loss = "allow"
inline-always = "allow"
module-name-repetitions = "allow"
must-use-candidate = "allow"
return-self-not-must-use = "allow"
similar-names = "allow"
single-match-else = "allow"
too-many-lines = "allow"
unnecessary-wraps = "allow"
unreadable-literal = "allow"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustc-args = ["--cfg", "docsrs"]

[features]
default = ["api"]
api = ["async-trait", "base64", "chrono", "reqwest", "serde_json"]
bot-autoposter = ["api", "tokio"]
autoposter = ["bot-autoposter"]

serenity = ["dep:serenity", "paste"]
serenity-cached = ["serenity", "serenity/cache"]
api = ["async-trait", "reqwest", "serde_json", "urlencoding"]

twilight = ["twilight-model", "twilight-http"]
twilight-cached = ["twilight", "twilight-cache-inmemory"]
serenity = ["dep:serenity"]
twilight = ["twilight-http", "twilight-model"]

webhooks = []
rocket = ["webhooks", "dep:rocket"]
axum = ["webhooks", "async-trait", "serde_json", "dep:axum"]
warp = ["webhooks", "async-trait", "dep:warp"]
actix-web = ["webhooks", "dep:actix-web"]
rocket = ["webhooks", "hex", "hmac", "serde_json", "sha2", "dep:rocket"]
axum = ["webhooks", "async-trait", "hex", "hmac", "serde_json", "sha2", "dep:axum"]
warp = ["webhooks", "bytes", "hex", "hmac", "serde_json", "sha2", "dep:warp"]
actix-web = ["webhooks", "futures-core", "hex", "hmac", "serde_json", "sha2", "dep:actix-web"]

[lints.rust]
unsafe_code = "forbid"

[lints.rustdoc]
broken_intra_doc_links = "deny"

[lints.clippy]
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
Loading