@@ -15,21 +15,25 @@ use std::{fs, io::Read, num::NonZero, path::Path};
1515#[ derive( Debug , Clone ) ]
1616pub enum HashAlgorithm {
1717 /// SHA-256 hash algorithm with the expected checksum value.
18+ ///
19+ /// Used by the PyPI downloader.
1820 Sha256 ( String ) ,
1921
2022 /// BLAKE2b-256 hash algorithm with the expected checksum value.
23+ ///
24+ /// Used by the PyPI downloader.
2125 Blake2b256 ( String ) ,
2226
2327 /// SHA-512 hash algorithm with the expected checksum value.
24- # [ cfg ( any (
25- // Windows support is only for x86_64 architecture (for now)
26- all ( target_os = "windows" , target_arch = "x86_64" ) ,
27- // Linux and macOS support only x86_64 and aarch64 architectures
28+ ///
29+ /// Used exclusively by the static distribution downloader.
30+ # [ cfg (
31+ // Windows, Linux, and MacOS support only x86_64 and aarch64 architectures
2832 all(
29- any( target_os = "linux" , target_os = "macos" ) ,
33+ any( target_os = "windows" , target_os = " linux", target_os = "macos" ) ,
3034 any( target_arch = "x86_64" , target_arch = "aarch64" )
31- ) ,
32- ) ) ]
35+ )
36+ ) ]
3337 Sha512 ( String ) ,
3438}
3539
@@ -85,15 +89,13 @@ impl HashAlgorithm {
8589 let hasher = Blake2b :: < U32 > :: new ( ) ;
8690 Self :: hash_file ( hasher, file_path, expected)
8791 }
88- #[ cfg( any(
89- // Windows support is only for x86_64 architecture (for now)
90- all( target_os = "windows" , target_arch = "x86_64" ) ,
91- // Linux and macOS support only x86_64 and aarch64 architectures
92+ #[ cfg(
93+ // Windows, Linux, and MacOS support only x86_64 and aarch64 architectures
9294 all(
93- any( target_os = "linux" , target_os = "macos" ) ,
95+ any( target_os = "windows" , target_os = " linux", target_os = "macos" ) ,
9496 any( target_arch = "x86_64" , target_arch = "aarch64" )
9597 ) ,
96- ) ) ]
98+ ) ]
9799 HashAlgorithm :: Sha512 ( expected) => {
98100 use sha2:: { Digest , Sha512 } ;
99101
0 commit comments