From 88c4a9947ebe1725ff2f20d2b25610d7c0128bc5 Mon Sep 17 00:00:00 2001 From: "D. Scott Boggs" Date: Tue, 23 May 2023 12:59:31 -0400 Subject: doc_comment! macro is unnecessary --- src/macros.rs | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index 1bbb7bd..2ee50bc 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1,30 +1,28 @@ macro_rules! methods { ($($method:ident and $method_with_call_id:ident,)+) => { $( - doc_comment! { - concat!("Make a ", stringify!($method), " API request, and deserialize the result into T"), - async fn $method serde::Deserialize<'de> + serde::Serialize>(&self, url: impl AsRef) -> Result - { - let call_id = uuid::Uuid::new_v4(); - self.$method_with_call_id(url, call_id).await - } + #[allow(dead_code)] + #[doc=concat!("Make a ", stringify!($method), " API request, and deserialize the result into T")] + async fn $method serde::Deserialize<'de> + serde::Serialize>(&self, url: impl AsRef) -> Result + { + let call_id = uuid::Uuid::new_v4(); + self.$method_with_call_id(url, call_id).await } - doc_comment! { - concat!( + #[allow(dead_code)] + #[doc=concat!( "Make a ", stringify!($method), " API request, and deserialize the result into T.\n\n", "Logging will use the provided UUID, rather than generating one before making the request.", - ), - async fn $method_with_call_id serde::Deserialize<'de> + serde::Serialize>(&self, url: impl AsRef, call_id: Uuid) -> Result - { + )] + async fn $method_with_call_id serde::Deserialize<'de> + serde::Serialize>(&self, url: impl AsRef, call_id: Uuid) -> Result + { - use log::debug; + use log::debug; - let url = url.as_ref(); - debug!(url = url, method = stringify!($method), call_id:? = call_id; "making API request"); - let response = self.authenticated(self.client.$method(url)).header("Accept", "application/json").send().await?; - read_response(response).await - } + let url = url.as_ref(); + debug!(url = url, method = stringify!($method), call_id:? = call_id; "making API request"); + let response = self.authenticated(self.client.$method(url)).header("Accept", "application/json").send().await?; + read_response(response).await } )+ }; -- cgit v1.2.3