Skip to content

Commit 33c669c

Browse files
committed
clippy
1 parent 37a25e6 commit 33c669c

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

examples/dev_proxy.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ async fn main() {
118118
req.headers_mut().insert(
119119
hyper::header::HOST,
120120
hyper::header::HeaderValue::from_maybe_shared(format!(
121-
"127.0.0.1:{}",
122-
port
121+
"127.0.0.1:{port}"
123122
))
124123
.unwrap(),
125124
);
@@ -128,8 +127,7 @@ async fn main() {
128127
parts.scheme = Some(hyper::http::uri::Scheme::HTTP);
129128
parts.authority = Some(
130129
hyper::http::uri::Authority::from_maybe_shared(format!(
131-
"127.0.0.1:{}",
132-
port
130+
"127.0.0.1:{port}"
133131
))
134132
.unwrap(),
135133
);

src/default_client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,20 @@ impl DefaultClient {
8282
#[cfg(feature = "native-tls-client")]
8383
pub fn new() -> Self {
8484
Self::try_new().unwrap_or_else(|err| {
85-
panic!("Failed to create DefaultClient: {}", err);
85+
panic!("Failed to create DefaultClient: {err}");
8686
})
8787
}
8888

8989
#[cfg(feature = "native-tls-client")]
9090
pub fn try_new() -> Result<Self, Error> {
9191
let tls_connector_no_alpn = native_tls::TlsConnector::builder().build().map_err(|e| {
92-
Error::TlsConnectorError(format!("Failed to build no-ALPN connector: {}", e))
92+
Error::TlsConnectorError(format!("Failed to build no-ALPN connector: {e}"))
9393
})?;
9494
let tls_connector_alpn_h2 = native_tls::TlsConnector::builder()
9595
.request_alpns(&["h2", "http/1.1"])
9696
.build()
9797
.map_err(|e| {
98-
Error::TlsConnectorError(format!("Failed to build ALPN-H2 connector: {}", e))
98+
Error::TlsConnectorError(format!("Failed to build ALPN-H2 connector: {e}"))
9999
})?;
100100

101101
Ok(Self {

src/tls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn generate_cert(
2727

2828
let key_pair = rcgen::KeyPair::generate()?;
2929

30-
let cert = cert_params.signed_by(&key_pair, &issuer)?;
30+
let cert = cert_params.signed_by(&key_pair, issuer)?;
3131

3232
Ok(CertifiedKeyDer {
3333
cert_der: cert.der().to_vec(),

tests/test.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ async fn bind_app(app: Router) -> (u16, impl std::future::Future<Output = ()>) {
6262

6363
fn client(proxy_port: u16) -> reqwest::Client {
6464
reqwest::Client::builder()
65-
.proxy(reqwest::Proxy::http(format!("http://127.0.0.1:{}", proxy_port)).unwrap())
66-
.proxy(reqwest::Proxy::https(format!("http://127.0.0.1:{}", proxy_port)).unwrap())
65+
.proxy(reqwest::Proxy::http(format!("http://127.0.0.1:{proxy_port}")).unwrap())
66+
.proxy(reqwest::Proxy::https(format!("http://127.0.0.1:{proxy_port}")).unwrap())
6767
.build()
6868
.unwrap()
6969
}
7070

7171
fn client_tls(proxy_port: u16, cert: &rcgen::Certificate) -> reqwest::Client {
7272
reqwest::Client::builder()
73-
.proxy(reqwest::Proxy::http(format!("http://127.0.0.1:{}", proxy_port)).unwrap())
74-
.proxy(reqwest::Proxy::https(format!("http://127.0.0.1:{}", proxy_port)).unwrap())
73+
.proxy(reqwest::Proxy::http(format!("http://127.0.0.1:{proxy_port}")).unwrap())
74+
.proxy(reqwest::Proxy::https(format!("http://127.0.0.1:{proxy_port}")).unwrap())
7575
.add_root_certificate(reqwest::Certificate::from_der(cert.der()).unwrap())
7676
.build()
7777
.unwrap()
@@ -145,7 +145,7 @@ async fn test_simple_http() {
145145
let client = client(proxy_port);
146146

147147
let res = client
148-
.get(format!("http://127.0.0.1:{}/", port))
148+
.get(format!("http://127.0.0.1:{port}/"))
149149
.send()
150150
.await
151151
.unwrap();
@@ -184,7 +184,7 @@ async fn test_modify_http() {
184184
let client = client(proxy_port);
185185

186186
let res = client
187-
.get(format!("http://127.0.0.1:{}/", port))
187+
.get(format!("http://127.0.0.1:{port}/"))
188188
.send()
189189
.await
190190
.unwrap();
@@ -216,7 +216,7 @@ async fn test_sse_http() {
216216

217217
let client = client(proxy_port);
218218
let res = client
219-
.get(format!("http://127.0.0.1:{}/sse", port))
219+
.get(format!("http://127.0.0.1:{port}/sse"))
220220
.send()
221221
.await
222222
.unwrap();
@@ -273,7 +273,7 @@ async fn test_simple_https() {
273273
let client = client_tls(proxy_port, &cert);
274274

275275
let res = client
276-
.get(format!("https://127.0.0.1:{}/", port))
276+
.get(format!("https://127.0.0.1:{port}/"))
277277
.send()
278278
.await
279279
.unwrap();

0 commit comments

Comments
 (0)