From c83c304bbe714e50591b988e7ed37fc3170eefae Mon Sep 17 00:00:00 2001 From: TotallyNot <44345987+TotallyNot@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:27:00 +0200 Subject: [PATCH] adjust visibility of inner response --- torn-api-macros/Cargo.toml | 2 +- torn-api-macros/src/lib.rs | 2 +- torn-api/Cargo.toml | 4 ++-- torn-key-pool/Cargo.toml | 2 +- torn-key-pool/src/send.rs | 8 ++++++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/torn-api-macros/Cargo.toml b/torn-api-macros/Cargo.toml index f05c5ac..66e7a0e 100644 --- a/torn-api-macros/Cargo.toml +++ b/torn-api-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "torn-api-macros" -version = "0.3.0" +version = "0.3.1" edition = "2021" authors = ["Pyrit [2111649]"] license = "MIT" diff --git a/torn-api-macros/src/lib.rs b/torn-api-macros/src/lib.rs index c2d70a1..dcf0bbf 100644 --- a/torn-api-macros/src/lib.rs +++ b/torn-api-macros/src/lib.rs @@ -141,7 +141,7 @@ fn impl_api_category(ast: &syn::DeriveInput) -> TokenStream { ); let gen = quote! { - pub struct Response(crate::ApiResponse); + pub struct Response(pub crate::ApiResponse); impl Response { #(#accessors)* diff --git a/torn-api/Cargo.toml b/torn-api/Cargo.toml index 95dc93f..53d3307 100644 --- a/torn-api/Cargo.toml +++ b/torn-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "torn-api" -version = "0.7.0" +version = "0.7.1" edition = "2021" rust-version = "1.75.0" authors = ["Pyrit [2111649]"] @@ -39,7 +39,7 @@ reqwest = { version = "0.11", default-features = false, features = [ "json" ], o awc = { version = "3", default-features = false, optional = true } rust_decimal = { version = "1", default-features = false, optional = true, features = [ "serde" ] } -torn-api-macros = { path = "../torn-api-macros", version = "0.3" } +torn-api-macros = { path = "../torn-api-macros", version = "0.3.1" } [dev-dependencies] actix-rt = { version = "2.7.0" } diff --git a/torn-key-pool/Cargo.toml b/torn-key-pool/Cargo.toml index 816824f..ccc3843 100644 --- a/torn-key-pool/Cargo.toml +++ b/torn-key-pool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "torn-key-pool" -version = "0.8.1" +version = "0.8.2" edition = "2021" authors = ["Pyrit [2111649]"] license = "MIT" diff --git a/torn-key-pool/src/send.rs b/torn-key-pool/src/send.rs index 6572c9c..ef952d6 100644 --- a/torn-key-pool/src/send.rs +++ b/torn-key-pool/src/send.rs @@ -29,7 +29,9 @@ where where A: ApiSelection, { - request.comment = self.options.comment.clone(); + if request.comment.is_none() { + request.comment = self.options.comment.clone(); + } if let Some(hook) = self.options.hooks_before.get(&std::any::TypeId::of::()) { let concrete = hook .downcast_ref::>() @@ -113,7 +115,9 @@ where } }; - request.comment = self.options.comment.clone(); + if request.comment.is_none() { + request.comment = self.options.comment.clone(); + } let request_ref = &request; let tuples =