From 05c23386ce726793a14b87c55dba2fe5c33985b4 Mon Sep 17 00:00:00 2001 From: Florentin Dubois Date: Fri, 1 Jul 2022 15:59:30 +0200 Subject: [PATCH 1/2] Update serde_json dependendecy * Bump serde_json to 1.0.82 Signed-off-by: Florentin Dubois --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c8f602d..fbdc001 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ lazy_static = { version = "^1.4.0", optional = true } log = { version = "^0.4.17", optional = true } prometheus = { version = "^0.13.1", optional = true } serde = { version = "^1.0.137", features = ["derive"], optional = true } -serde_json = { version = "^1.0.81", features = [ +serde_json = { version = "^1.0.82", features = [ "preserve_order", "float_roundtrip", ], optional = true } From 2192cab48a6058e79856b659dd6384810ebec2bd Mon Sep 17 00:00:00 2001 From: Florentin Dubois Date: Fri, 1 Jul 2022 16:17:45 +0200 Subject: [PATCH 2/2] Fix clippy linter issue * Use `write!` instead of `s += &format!` Signed-off-by: Florentin Dubois --- src/client/proxy.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/proxy.rs b/src/client/proxy.rs index 8d061cc..bd1b8d8 100644 --- a/src/client/proxy.rs +++ b/src/client/proxy.rs @@ -4,7 +4,7 @@ //! with proxy capabilities use std::{ - fmt::{self, Debug, Display, Formatter}, + fmt::{self, Debug, Display, Formatter, Write}, marker::PhantomData, net::IpAddr, str::FromStr, @@ -40,6 +40,8 @@ pub enum Error { ParseDirect(String), #[error("failed to parse '{0}' as url, {1}")] ParseUrl(String, url::ParseError), + #[error("failed to format query params in url, {0}")] + FormatUrl(fmt::Error), } // ----------------------------------------------------------------------------- @@ -262,7 +264,7 @@ impl ProxyBuilder { let mut p_and_q = url.path().to_string(); if let Some(q) = url.query() { - p_and_q += &format!("?{}", q); + write!(p_and_q, "?{}", q).map_err(Error::FormatUrl)?; } let uri = Uri::builder()