Skip to content

Commit fd1082c

Browse files
committed
Update Url dependency
This commit updates the Url dependency to match that used by Reqwest. Pass url in order to use Reqwest's IntoUrl trait.
1 parent b0a0d03 commit fd1082c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

elasticsearch/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ base64 = "0.11.0"
1515
bytes = "^0.5"
1616
dyn-clone = "1.0.1"
1717
reqwest = { version = "0.10.0", features = ["gzip", "json", "native-tls"] }
18-
url = "1.7.2"
18+
url = "^2.1"
1919
serde = { version = "~1", features = ["derive"] }
2020
serde_json = "~1"
2121
serde_with = "~1"

elasticsearch/src/http/transport.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ impl TransportBuilder {
129129

130130
if self.disable_proxy {
131131
client_builder = client_builder.no_proxy();
132-
} else if let Some(url) = &self.proxy {
132+
} else if let Some(url) = self.proxy {
133133
client_builder = match url.scheme() {
134-
"https" => client_builder.proxy(reqwest::Proxy::https(&url.to_string())?),
135-
_ => client_builder.proxy(reqwest::Proxy::http(&url.to_string())?),
134+
"https" => client_builder.proxy(reqwest::Proxy::https(url)?),
135+
_ => client_builder.proxy(reqwest::Proxy::http(url)?),
136136
};
137137
}
138138

@@ -222,7 +222,7 @@ impl Transport {
222222
let connection = self.conn_pool.next();
223223
let url = connection.url.join(path)?;
224224
let reqwest_method = self.method(method);
225-
let mut request_builder = self.client.request(reqwest_method, &url.to_string());
225+
let mut request_builder = self.client.request(reqwest_method, url);
226226

227227
let mut headers = headers;
228228
headers.insert(CONTENT_TYPE, HeaderValue::from_static(DEFAULT_CONTENT_TYPE));

0 commit comments

Comments
 (0)