Skip to content

Commit 7a95dc4

Browse files
committed
chore: reduce number of clippy warnings when no TLS stack is enabled
1 parent 1da67fd commit 7a95dc4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/tools.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
use std::collections::HashMap;
55
use std::path::PathBuf;
66

7-
use crate::common::check_target_not_found_err;
87
use anyhow::{anyhow, bail, ensure, Context, Result};
98
use directories::ProjectDirs;
109
use futures_util::stream::StreamExt;
@@ -452,17 +451,20 @@ pub async fn cache_dir() -> Result<PathBuf> {
452451
}
453452

454453
async fn get_http_client(client_options: &HttpClientOptions) -> Result<reqwest::Client> {
455-
let mut builder = reqwest::ClientBuilder::new();
454+
let builder = reqwest::ClientBuilder::new();
456455

457456
#[cfg(any(feature = "native-tls", feature = "rustls"))]
458457
let builder = {
459-
builder = builder.danger_accept_invalid_certs(client_options.accept_invalid_certificates);
458+
let mut builder =
459+
builder.danger_accept_invalid_certs(client_options.accept_invalid_certificates);
460460

461461
if let Some(root_certs) = &client_options.root_certificate {
462462
let cert = tokio::fs::read(root_certs)
463463
.await
464464
.with_context(|| "Error reading certificate")
465-
.map_err(|err| check_target_not_found_err(err, &root_certs.to_string_lossy()))?;
465+
.map_err(|err| {
466+
crate::common::check_target_not_found_err(err, &root_certs.to_string_lossy())
467+
})?;
466468

467469
builder = builder.add_root_certificate(
468470
reqwest::Certificate::from_pem(&cert)

0 commit comments

Comments
 (0)