diff options
author | D. Scott Boggs <scott@tams.tech> | 2023-05-23 12:59:31 -0400 |
---|---|---|
committer | D. Scott Boggs <scott@tams.tech> | 2024-04-08 09:29:48 -0400 |
commit | 88c4a9947ebe1725ff2f20d2b25610d7c0128bc5 (patch) | |
tree | 8f419d82a71efbe56b33bd8fc08d8abeb7b94315 | |
parent | a8582cace451f311e661c42228b465bec767ee4e (diff) |
doc_comment! macro is unnecessary
-rw-r--r-- | src/macros.rs | 34 |
1 files 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<T: for<'de> serde::Deserialize<'de> + serde::Serialize>(&self, url: impl AsRef<str>) -> Result<T> - { - 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<T: for<'de> serde::Deserialize<'de> + serde::Serialize>(&self, url: impl AsRef<str>) -> Result<T> + { + 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<T: for<'de> serde::Deserialize<'de> + serde::Serialize>(&self, url: impl AsRef<str>, call_id: Uuid) -> Result<T> - { + )] + async fn $method_with_call_id<T: for<'de> serde::Deserialize<'de> + serde::Serialize>(&self, url: impl AsRef<str>, call_id: Uuid) -> Result<T> + { - 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 } )+ }; |