From fd81e6ee0dcfe80e94c5ddd7751c45f5a3f3aca8 Mon Sep 17 00:00:00 2001 From: Luca Cappelletti Date: Sat, 24 May 2025 17:50:14 +0200 Subject: [PATCH] Resolved collisions between `missing_docs` clippy lints (#3653) * Trying to resolve the clippy forbid(missing_doc) in web codegen * Specifying to use workspace version * Restored cargo toml as they were * Restored toml and lock to original * Replaced `#[doc(hidden)]` with documentation comments * Reformatted code * Removed auto-generated doc comment as existing doc comment should be fine --- actix-web-codegen/src/route.rs | 3 ++- actix-web/src/response/http_codes.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/actix-web-codegen/src/route.rs b/actix-web-codegen/src/route.rs index e24903e3a..cd1ad4c66 100644 --- a/actix-web-codegen/src/route.rs +++ b/actix-web-codegen/src/route.rs @@ -59,6 +59,7 @@ macro_rules! standard_method_type { ( $($variant:ident, $upper:ident, $lower:ident,)+ ) => { + #[doc(hidden)] #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum MethodType { $( @@ -466,7 +467,7 @@ impl ToTokens for Route { let stream = quote! { #(#doc_attributes)* - #[allow(non_camel_case_types, missing_docs)] + #[allow(non_camel_case_types)] #vis struct #name; impl ::actix_web::dev::HttpServiceFactory for #name { diff --git a/actix-web/src/response/http_codes.rs b/actix-web/src/response/http_codes.rs index db5f392c9..1427ee16a 100644 --- a/actix-web/src/response/http_codes.rs +++ b/actix-web/src/response/http_codes.rs @@ -6,7 +6,8 @@ use crate::{HttpResponse, HttpResponseBuilder}; macro_rules! static_resp { ($name:ident, $status:expr) => { - #[allow(non_snake_case, missing_docs)] + #[allow(non_snake_case)] + #[doc = concat!("Creates a new response builder with the status code `", stringify!($status), "`.")] pub fn $name() -> HttpResponseBuilder { HttpResponseBuilder::new($status) }