Skip to content

Commit 5b3f2cb

Browse files
committed
feat(download-backend)!: refine selection logic
1 parent 7a689aa commit 5b3f2cb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/utils/utils.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,12 @@ fn download_file_(
221221
// Download the file
222222

223223
// Keep the curl env var around for a bit
224-
let use_curl_backend = process().var_os("RUSTUP_USE_CURL").is_some();
225-
let use_rustls = process().var_os("RUSTUP_USE_RUSTLS").is_some();
224+
let use_curl_backend = process()
225+
.var_os("RUSTUP_USE_CURL")
226+
.map_or(false, |it| it != "0");
227+
let use_rustls = process()
228+
.var_os("RUSTUP_USE_RUSTLS")
229+
.map_or(false, |it| it != "0");
226230
let (backend, notification) = if use_curl_backend {
227231
(Backend::Curl, Notification::UsingCurl)
228232
} else {

0 commit comments

Comments
 (0)