diff options
| author | binarycat <binarycat@envs.net> | 2024-08-16 23:25:18 -0400 |
|---|---|---|
| committer | binarycat <binarycat@envs.net> | 2024-08-16 23:25:18 -0400 |
| commit | b3ec296f3d918efdbe4db02dbd7fbc7fea1641a1 (patch) | |
| tree | 95707d2d174bcf5095fc38000fb9dec722c7a9b1 /src | |
| parent | 12e638978814d84e4e09b172f784d5f16759d8e1 (diff) | |
| download | rust-b3ec296f3d918efdbe4db02dbd7fbc7fea1641a1.tar.gz rust-b3ec296f3d918efdbe4db02dbd7fbc7fea1641a1.zip | |
autoformat and remove unit test
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/src/core/download.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs index ed7637e8ee0..2bde05501fc 100644 --- a/src/bootstrap/src/core/download.rs +++ b/src/bootstrap/src/core/download.rs @@ -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"); |
