summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mod.rs13
-rw-r--r--src/utils/request.rs1
2 files changed, 5 insertions, 9 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index 7aa1801..9dde751 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -217,15 +217,12 @@ pub fn is_url(path: &str) -> bool {
pub fn set_proxy(
mut builder: reqwest::ClientBuilder,
- proxy: Option<&String>,
+ proxy: &str,
) -> Result<reqwest::ClientBuilder> {
- if let Some(proxy) = proxy {
- builder = builder.no_proxy();
- if !proxy.is_empty() && proxy != "-" {
- builder = builder.proxy(
- reqwest::Proxy::all(proxy).with_context(|| format!("Invalid proxy `{proxy}`"))?,
- );
- }
+ builder = builder.no_proxy();
+ if !proxy.is_empty() && proxy != "-" {
+ builder = builder
+ .proxy(reqwest::Proxy::all(proxy).with_context(|| format!("Invalid proxy `{proxy}`"))?);
};
Ok(builder)
}
diff --git a/src/utils/request.rs b/src/utils/request.rs
index a479e0e..efcd102 100644
--- a/src/utils/request.rs
+++ b/src/utils/request.rs
@@ -29,7 +29,6 @@ const USER_AGENT: &str = "curl/8.6.0";
lazy_static::lazy_static! {
static ref CLIENT: Result<reqwest::Client> = {
let builder = reqwest::ClientBuilder::new().timeout(Duration::from_secs(30));
- let builder = set_proxy(builder, None)?;
let client = builder.build()?;
Ok(client)
};