From 1868c049b0794b002ddf4850d24c46ac3eec68bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:19:45 +0000 Subject: [PATCH 1/2] Update dxr_client requirement from 0.6.2 to 0.7.0 Updates the requirements on [dxr_client](https://github.com/ironthree/dxr) to permit the latest version. - [Release notes](https://github.com/ironthree/dxr/releases) - [Changelog](https://github.com/ironthree/dxr/blob/main/CHANGELOG.md) - [Commits](https://github.com/ironthree/dxr/compare/0.6.2...0.7.0) --- updated-dependencies: - dependency-name: dxr_client dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9f6d522..b3c6975 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ description = "nickserv account verification URL bot" [dependencies] clap = { version = "4.5.9", features = ["derive"] } -dxr_client = { version = "0.6.2", features = ["reqwest"] } +dxr_client = { version = "0.7.0", features = ["reqwest"] } http = "0.2.12" # warp is stuck on an old version http-serde = "1.1.3" hyper = "1.4.1" From 5c919fda92357b030973c6ba1149706b6f58350b Mon Sep 17 00:00:00 2001 From: daemoness Date: Thu, 5 Dec 2024 09:39:18 -0800 Subject: [PATCH 2/2] Fix incompatibility with dxr_client 0.7 --- src/xmlrpc.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/xmlrpc.rs b/src/xmlrpc.rs index 9ee4728..8425ef4 100644 --- a/src/xmlrpc.rs +++ b/src/xmlrpc.rs @@ -1,4 +1,4 @@ -use dxr_client::{Call, Client, ClientBuilder}; +use dxr_client::{Client, ClientBuilder, ClientError}; use url::Url; pub struct Xmlrpc { @@ -11,23 +11,23 @@ impl Xmlrpc { } } - fn request<'a>( + async fn request<'a>( + &self, service: &'static str, command: &'static str, params: Vec<&'a str>, - ) -> Call<'a, Vec<&'a str>, String> { - Call::new( - "atheme.command", - [vec!["", "", "127.0.0.1", service, command], params].concat(), - ) + ) -> Result<(), ClientError> { + self.client + .call( + "atheme.command", + [vec!["", "", "127.0.0.1", service, command], params].concat(), + ) + .await } pub async fn verify(&self, account: &str, token: &str) -> Result<(), String> { - let request = Xmlrpc::request("NickServ", "VERIFY", vec!["REGISTER", account, token]); - self.client - .call(request) + self.request("NickServ", "VERIFY", vec!["REGISTER", account, token]) .await - .map(|_| ()) .map_err(|e| format!("{e:?}")) } }