@@ -437,16 +437,17 @@ def download_toolchain(self):
437437 os .makedirs (rustc_cache )
438438
439439 tarball_suffix = '.tar.gz' if lzma is None else '.tar.xz'
440- filename = "rust-std-{}-{}{}" .format (
441- rustc_channel , self .build , tarball_suffix )
442- pattern = "rust-std-{}" .format (self .build )
443- self ._download_component_helper (filename , pattern , tarball_suffix , rustc_cache )
444- filename = "rustc-{}-{}{}" .format (rustc_channel , self .build ,
445- tarball_suffix )
446- self ._download_component_helper (filename , "rustc" , tarball_suffix , rustc_cache )
447- filename = "cargo-{}-{}{}" .format (rustc_channel , self .build ,
448- tarball_suffix )
449- self ._download_component_helper (filename , "cargo" , tarball_suffix , rustc_cache )
440+
441+ tarballs_to_download = [
442+ ("rust-std-{}-{}{}" .format (rustc_channel , self .build , tarball_suffix ),
443+ "rust-std-{}" .format (self .build )),
444+ ("rustc-{}-{}{}" .format (rustc_channel , self .build , tarball_suffix ), "rustc" ),
445+ ("cargo-{}-{}{}" .format (rustc_channel , self .build , tarball_suffix ), "cargo" ),
446+ ]
447+
448+ for filename , pattern in tarballs_to_download :
449+ self ._download_component_helper (filename , pattern , tarball_suffix , rustc_cache )
450+
450451 if self .should_fix_bins_and_dylibs ():
451452 self .fix_bin_or_dylib ("{}/bin/cargo" .format (bin_root ))
452453
0 commit comments