Skip to content

Commit

Permalink
autoformat and remove unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
lolbinarycat committed Aug 17, 2024
1 parent 12e6389 commit b3ec296
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/bootstrap/src/core/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,10 @@ fn extract_curl_version(out: &[u8]) -> f32 {
let Some(i) = out.iter().position(|&x| x == b' ') else { return 0.0 };
let out = &out[..i];
let Some(k) = out.iter().rev().position(|&x| x == b'.') else { return 0.0 };
let out = &out[..out.len()-k-1];
let out = &out[..out.len() - k - 1];
std::str::from_utf8(out).unwrap().parse().unwrap_or(0.0)
}

#[test]
fn test_extract_curl_version() {
assert_eq!(extract_curl_version(b"\
curl 8.4.0 (x86_64-pc-linux-gnu) libcurl/8.4.0 \
OpenSSL/3.0.13 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.4 \
libssh2/1.11.0 nghttp2/1.57.0"), 8.4);
}

fn curl_version() -> f32 {
let mut curl = Command::new("curl");
curl.arg("-V");
Expand Down

0 comments on commit b3ec296

Please sign in to comment.