From d0aff24c85836d5d314d291290cdde921419da5e Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sun, 25 May 2025 08:46:05 +0200 Subject: [PATCH] Reorder some TOML sections (#3360) --- axum-core/Cargo.toml | 35 ++++++------ axum-extra/Cargo.toml | 65 +++++++++++++--------- axum-macros/Cargo.toml | 18 +++--- axum/Cargo.toml | 77 +++++++++++++------------- axum/src/docs/extract.md | 1 - examples/simple-router-wasm/Cargo.toml | 6 +- examples/websockets/Cargo.toml | 16 +++--- 7 files changed, 113 insertions(+), 105 deletions(-) diff --git a/axum-core/Cargo.toml b/axum-core/Cargo.toml index 99d1b859..8c95cd66 100644 --- a/axum-core/Cargo.toml +++ b/axum-core/Cargo.toml @@ -11,6 +11,23 @@ readme = "README.md" repository = "https://github.com/tokio-rs/axum" version = "0.5.2" # remember to bump the version that axum and axum-extra depend on +[package.metadata.cargo-public-api-crates] +allowed = [ + # not 1.0 + "futures_core", + "tower_layer", + # >=1.0 + "bytes", + "http", + "http_body", +] + +[package.metadata.cargo-machete] +ignored = ["tower-http"] # See __private_docs feature + +[package.metadata.docs.rs] +all-features = true + [features] tracing = ["dep:tracing"] @@ -44,21 +61,3 @@ tower-http = { version = "0.6.0", features = ["limit"] } [lints] workspace = true - -[package.metadata.cargo-public-api-crates] -allowed = [ - # not 1.0 - "futures_core", - "tower_layer", - - # >=1.0 - "bytes", - "http", - "http_body", -] - -[package.metadata.cargo-machete] -ignored = ["tower-http"] # See __private_docs feature - -[package.metadata.docs.rs] -all-features = true diff --git a/axum-extra/Cargo.toml b/axum-extra/Cargo.toml index 19eeb2bf..bb4937b1 100644 --- a/axum-extra/Cargo.toml +++ b/axum-extra/Cargo.toml @@ -11,11 +11,42 @@ readme = "README.md" repository = "https://github.com/tokio-rs/axum" version = "0.10.1" +[package.metadata.docs.rs] +all-features = true + +[package.metadata.cargo-public-api-crates] +allowed = [ + "axum", + "axum_core", + "axum_macros", + "bytes", + "cookie", + "futures_core", + "futures_util", + "headers", + "headers_core", + "http", + "http_body", + "pin_project_lite", + "prost", + "serde", + "tokio", + "tokio_util", + "tower_layer", + "tower_service", +] + [features] default = ["tracing"] async-read-body = ["dep:tokio-util", "tokio-util?/io", "dep:tokio"] -file-stream = ["dep:tokio-util", "tokio-util?/io", "dep:tokio", "tokio?/fs", "tokio?/io-util"] +file-stream = [ + "dep:tokio-util", + "tokio-util?/io", + "dep:tokio", + "tokio?/fs", + "tokio?/io-util", +] attachment = ["dep:tracing"] error-response = ["dep:tracing", "tracing/std"] cookie = ["dep:cookie"] @@ -39,7 +70,12 @@ scheme = [] query = ["dep:form_urlencoded", "dep:serde_html_form", "dep:serde_path_to_error"] tracing = ["axum-core/tracing", "axum/tracing", "dep:tracing"] typed-header = ["dep:headers"] -typed-routing = ["dep:axum-macros", "dep:percent-encoding", "dep:serde_html_form", "dep:form_urlencoded"] +typed-routing = [ + "dep:axum-macros", + "dep:percent-encoding", + "dep:serde_html_form", + "dep:form_urlencoded", +] # Enabled by docs.rs because it uses all-features __private_docs = [ @@ -95,28 +131,3 @@ tracing-subscriber = "0.3.19" [lints] workspace = true - -[package.metadata.docs.rs] -all-features = true - -[package.metadata.cargo-public-api-crates] -allowed = [ - "axum", - "axum_core", - "axum_macros", - "bytes", - "cookie", - "futures_core", - "futures_util", - "headers", - "headers_core", - "http", - "http_body", - "pin_project_lite", - "prost", - "serde", - "tokio", - "tokio_util", - "tower_layer", - "tower_service", -] diff --git a/axum-macros/Cargo.toml b/axum-macros/Cargo.toml index 676f35fd..049de497 100644 --- a/axum-macros/Cargo.toml +++ b/axum-macros/Cargo.toml @@ -11,13 +11,19 @@ readme = "README.md" repository = "https://github.com/tokio-rs/axum" version = "0.5.0" # remember to also bump the version that axum and axum-extra depends on -[features] -default = [] -__private = ["syn/visit-mut"] +[package.metadata.cargo-public-api-crates] +allowed = [] + +[package.metadata.docs.rs] +all-features = true [lib] proc-macro = true +[features] +default = [] +__private = ["syn/visit-mut"] + [dependencies] proc-macro2 = "1.0" quote = "1.0" @@ -40,9 +46,3 @@ trybuild = "1.0.63" [lints] workspace = true - -[package.metadata.cargo-public-api-crates] -allowed = [] - -[package.metadata.docs.rs] -all-features = true diff --git a/axum/Cargo.toml b/axum/Cargo.toml index 237934e5..f8d365f1 100644 --- a/axum/Cargo.toml +++ b/axum/Cargo.toml @@ -11,6 +11,34 @@ license = "MIT" readme = "README.md" repository = "https://github.com/tokio-rs/axum" +[package.metadata.docs.rs] +all-features = true + +[package.metadata.playground] +features = ["http1", "http2", "json", "multipart", "ws"] + +[package.metadata.cargo-public-api-crates] +allowed = [ + # our crates + "axum_core", + "axum_macros", + # not 1.0 + "futures_core", + "futures_sink", + "futures_util", + "pin_project_lite", + "tower_layer", + "tower_service", + # >=1.0 + "bytes", + "http", + "http_body", + "serde", + "tokio", + # for the `__private` feature + "reqwest", +] + [features] default = [ "form", @@ -32,7 +60,14 @@ matched-path = [] multipart = ["dep:multer"] original-uri = [] query = ["dep:form_urlencoded", "dep:serde_urlencoded", "dep:serde_path_to_error"] -tokio = ["dep:hyper-util", "dep:tokio", "tokio/net", "tokio/rt", "tower/make", "tokio/macros"] +tokio = [ + "dep:hyper-util", + "dep:tokio", + "tokio/net", + "tokio/rt", + "tower/make", + "tokio/macros", +] tower-log = ["tower/log"] tracing = ["dep:tracing", "axum-core/tracing"] ws = ["dep:hyper", "tokio", "dep:tokio-tungstenite", "dep:sha1", "dep:base64"] @@ -42,7 +77,8 @@ __private_docs = [ # but they need the same sort of treatment as below to be complete "axum-core/__private_docs", # Enables upstream things linked to in docs - "tower/full", "dep:tower-http", + "tower/full", + "dep:tower-http", ] # This feature is used to enable private test helper usage @@ -187,43 +223,6 @@ features = [ [lints] workspace = true -[package.metadata.docs.rs] -all-features = true - -[package.metadata.playground] -features = [ - "http1", - "http2", - "json", - "multipart", - "ws", -] - -[package.metadata.cargo-public-api-crates] -allowed = [ - # our crates - "axum_core", - "axum_macros", - - # not 1.0 - "futures_core", - "futures_sink", - "futures_util", - "pin_project_lite", - "tower_layer", - "tower_service", - - # >=1.0 - "bytes", - "http", - "http_body", - "serde", - "tokio", - - # for the `__private` feature - "reqwest", -] - [[bench]] name = "benches" harness = false diff --git a/axum/src/docs/extract.md b/axum/src/docs/extract.md index 41252172..7da57086 100644 --- a/axum/src/docs/extract.md +++ b/axum/src/docs/extract.md @@ -686,5 +686,4 @@ logs, enable the `tracing` feature for axum (enabled by default) and the [customize-extractor-error]: https://github.com/tokio-rs/axum/blob/main/examples/customize-extractor-error/src/main.rs [`HeaderMap`]: https://docs.rs/http/latest/http/header/struct.HeaderMap.html [`Request`]: https://docs.rs/http/latest/http/struct.Request.html -[`RequestParts::body_mut`]: crate::extract::RequestParts::body_mut [`JsonRejection::JsonDataError`]: rejection::JsonRejection::JsonDataError diff --git a/examples/simple-router-wasm/Cargo.toml b/examples/simple-router-wasm/Cargo.toml index d250cc23..18c70540 100644 --- a/examples/simple-router-wasm/Cargo.toml +++ b/examples/simple-router-wasm/Cargo.toml @@ -4,6 +4,9 @@ version = "0.1.0" edition = "2018" publish = false +[package.metadata.cargo-machete] +ignored = ["axum-extra"] + [dependencies] # `default-features = false` to not depend on tokio features which don't support wasm # you can still pull in tokio manually and only add features that tokio supports for wasm @@ -14,6 +17,3 @@ axum-extra = { path = "../../axum-extra", default-features = false } futures-executor = "0.3.21" http = "1.0.0" tower-service = "0.3.1" - -[package.metadata.cargo-machete] -ignored = ["axum-extra"] diff --git a/examples/websockets/Cargo.toml b/examples/websockets/Cargo.toml index 0c1eb36a..6198e0bb 100644 --- a/examples/websockets/Cargo.toml +++ b/examples/websockets/Cargo.toml @@ -4,6 +4,14 @@ version = "0.1.0" edition = "2021" publish = false +[[bin]] +name = "example-websockets" +path = "src/main.rs" + +[[bin]] +name = "example-client" +path = "src/client.rs" + [dependencies] axum = { path = "../../axum", features = ["ws"] } axum-extra = { path = "../../axum-extra", features = ["typed-header"] } @@ -15,11 +23,3 @@ tokio-tungstenite = "0.26.0" tower-http = { version = "0.6.1", features = ["fs", "trace"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } - -[[bin]] -name = "example-websockets" -path = "src/main.rs" - -[[bin]] -name = "example-client" -path = "src/client.rs"