From 2c4a3b9d766489d2cde8f2dd35943ae0852004dd Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Sat, 24 May 2025 09:58:41 +0200 Subject: [PATCH] Replaced `#[doc(hidden)]` with documentation comments --- actix-web-codegen/src/route.rs | 6 +++++- actix-web/src/response/http_codes.rs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/actix-web-codegen/src/route.rs b/actix-web-codegen/src/route.rs index a5700b423..243f41558 100644 --- a/actix-web-codegen/src/route.rs +++ b/actix-web-codegen/src/route.rs @@ -465,9 +465,13 @@ impl ToTokens for Route { }) .collect(); + let documentation = format!( + "Struct generated by the routing macro for the handler function `{name}`.", + ); + let stream = quote! { #(#doc_attributes)* - #[doc(hidden)] + #[doc = #documentation] #[allow(non_camel_case_types)] #vis struct #name; diff --git a/actix-web/src/response/http_codes.rs b/actix-web/src/response/http_codes.rs index 6be50ee6f..1427ee16a 100644 --- a/actix-web/src/response/http_codes.rs +++ b/actix-web/src/response/http_codes.rs @@ -7,7 +7,7 @@ use crate::{HttpResponse, HttpResponseBuilder}; macro_rules! static_resp { ($name:ident, $status:expr) => { #[allow(non_snake_case)] - #[doc(hidden)] + #[doc = concat!("Creates a new response builder with the status code `", stringify!($status), "`.")] pub fn $name() -> HttpResponseBuilder { HttpResponseBuilder::new($status) }