Skip to content

Commit 0afbf1c

Browse files
author
Trevor Miranda
committed
Deprecate cURL
1 parent 194026d commit 0afbf1c

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/download/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
99

1010
[features]
1111

12-
default = ["curl-backend"]
12+
default = ["reqwest-backend"]
1313

1414
curl-backend = ["curl"]
1515
reqwest-backend = ["reqwest", "env_proxy", "lazy_static"]

src/rustup-utils/src/notifications.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ pub enum Notification<'a> {
2020
DownloadFinished,
2121
NoCanonicalPath(&'a Path),
2222
ResumingPartialDownload,
23-
UsingCurl,
2423
UsingReqwest,
24+
UsingCurl,
2525
UsingHyperDeprecated,
2626
}
2727

@@ -64,10 +64,9 @@ impl<'a> Display for Notification<'a> {
6464
ResumingPartialDownload => write!(f, "resuming partial download"),
6565
UsingCurl => write!(f, "downloading with curl"),
6666
UsingReqwest => write!(f, "downloading with reqwest"),
67-
UsingHyperDeprecated => f.write_str(
68-
"RUSTUP_USE_HYPER environment variable is deprecated,\
69-
use RUSTUP_USE_REQWEST instead",
70-
),
67+
UsingHyperDeprecated => {
68+
f.write_str("RUSTUP_USE_HYPER environment variable is deprecated.")
69+
}
7170
}
7271
}
7372
}

src/rustup-utils/src/utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ fn download_file_(
210210
if use_hyper_backend && DEPRECATED_HYPER_WARNED.swap(true, Ordering::Relaxed) {
211211
notify_handler(Notification::UsingHyperDeprecated);
212212
}
213-
let use_reqwest_backend = use_hyper_backend || env::var_os("RUSTUP_USE_REQWEST").is_some();
214-
let (backend, notification) = if use_reqwest_backend {
215-
(Backend::Reqwest, Notification::UsingReqwest)
216-
} else {
213+
let use_curl_backend = env::var_os("RUSTUP_USE_CURL").is_some();
214+
let (backend, notification) = if use_curl_backend {
217215
(Backend::Curl, Notification::UsingCurl)
216+
} else {
217+
(Backend::Reqwest, Notification::UsingReqwest)
218218
};
219219
notify_handler(notification);
220220
download_to_path_with_backend(backend, url, path, resume_from_partial, Some(callback))?;

0 commit comments

Comments
 (0)