Replaced `#[doc(hidden)]` with documentation comments

This commit is contained in:
LucaCappelletti94 2025-05-24 09:58:41 +02:00
parent 15c3ce59c8
commit 2c4a3b9d76
2 changed files with 6 additions and 2 deletions

View File

@ -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;

View File

@ -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)
}