From 56c709b33da44a0a2a3434f5cbf0965fb6d065f6 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 14 Nov 2024 21:12:16 +0100 Subject: [PATCH] Some documentation fixes (#3027) --- axum-core/Cargo.toml | 1 - axum-core/src/extract/rejection.rs | 2 +- axum-extra/Cargo.toml | 1 - axum-extra/src/extract/multipart.rs | 2 +- axum-extra/src/lib.rs | 2 +- axum-macros/Cargo.toml | 1 - axum/Cargo.toml | 10 +++++++--- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/axum-core/Cargo.toml b/axum-core/Cargo.toml index c7cffac6..d8207e13 100644 --- a/axum-core/Cargo.toml +++ b/axum-core/Cargo.toml @@ -59,4 +59,3 @@ ignored = ["tower-http"] # See __private_docs feature [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] diff --git a/axum-core/src/extract/rejection.rs b/axum-core/src/extract/rejection.rs index 34b8115b..c5c3b1db 100644 --- a/axum-core/src/extract/rejection.rs +++ b/axum-core/src/extract/rejection.rs @@ -42,7 +42,7 @@ define_rejection! { #[body = "Failed to buffer the request body"] /// Encountered some other error when buffering the body. /// - /// This can _only_ happen when you're using [`tower_http::limit::RequestBodyLimitLayer`] or + /// This can _only_ happen when you're using [`tower_http::limit::RequestBodyLimitLayer`] or /// otherwise wrapping request bodies in [`http_body_util::Limited`]. pub struct LengthLimitError(Error); } diff --git a/axum-extra/Cargo.toml b/axum-extra/Cargo.toml index 95aff92d..10459f70 100644 --- a/axum-extra/Cargo.toml +++ b/axum-extra/Cargo.toml @@ -85,7 +85,6 @@ tower-http = { version = "0.6.0", features = ["map-response-body", "timeout"] } [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] [package.metadata.cargo-public-api-crates] allowed = [ diff --git a/axum-extra/src/extract/multipart.rs b/axum-extra/src/extract/multipart.rs index cbbdfd42..bcfae64e 100644 --- a/axum-extra/src/extract/multipart.rs +++ b/axum-extra/src/extract/multipart.rs @@ -74,7 +74,7 @@ use std::{ /// to keep `Field`s around from previous loop iterations. That will minimize the risk of runtime /// errors. /// -/// # Differences between this and `axum::extract::Multipart` +/// # Differences between this and `axum::extract::Multipart` /// /// `axum::extract::Multipart` uses lifetimes to enforce field exclusivity at compile time, however /// that leads to significant usability issues such as `Field` not being `'static`. diff --git a/axum-extra/src/lib.rs b/axum-extra/src/lib.rs index 02dd6e69..9aa3ddf7 100644 --- a/axum-extra/src/lib.rs +++ b/axum-extra/src/lib.rs @@ -23,7 +23,7 @@ //! `query` | Enables the `Query` extractor | No //! `tracing` | Log rejections from built-in extractors | Yes //! `typed-routing` | Enables the `TypedPath` routing utilities | No -//! `typed-header` | Enables the `TypedHeader` extractor and response | No +//! `typed-header` | Enables the `TypedHeader` extractor and response | No //! //! [`axum`]: https://crates.io/crates/axum diff --git a/axum-macros/Cargo.toml b/axum-macros/Cargo.toml index 44e8e357..1960a465 100644 --- a/axum-macros/Cargo.toml +++ b/axum-macros/Cargo.toml @@ -43,4 +43,3 @@ allowed = [] [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] diff --git a/axum/Cargo.toml b/axum/Cargo.toml index 9aafd05e..ef113c33 100644 --- a/axum/Cargo.toml +++ b/axum/Cargo.toml @@ -37,8 +37,13 @@ tower-log = ["tower/log"] tracing = ["dep:tracing", "axum-core/tracing"] ws = ["dep:hyper", "tokio", "dep:tokio-tungstenite", "dep:sha1", "dep:base64"] -# Required for intra-doc links to resolve correctly -__private_docs = ["tower/full", "dep:tower-http"] +__private_docs = [ + # We re-export some docs from axum-core via #[doc(inline)], + # 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", +] [dependencies] axum-core = { path = "../axum-core", version = "0.5.0-alpha.1" } @@ -128,7 +133,6 @@ uuid = { version = "1.0", features = ["serde", "v4"] } [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] [dev-dependencies.tower] package = "tower"