@@ -205,17 +205,17 @@ impl Blacksmith {
205
205
206
206
let stable_links = platform. stable
207
207
. as_ref ( )
208
- . map ( |version| generate_standalone_links ( version, name, extension) )
208
+ . map ( |version| generate_standalone_links ( "rust" , version, name, extension) )
209
209
. unwrap_or_else ( String :: new) ;
210
210
211
211
let beta_links = if platform. beta {
212
- generate_standalone_links ( "beta" , name, extension)
212
+ generate_standalone_links ( "rust" , " beta", name, extension)
213
213
} else {
214
214
String :: new ( )
215
215
} ;
216
216
217
217
let nightly_links = if platform. nightly {
218
- generate_standalone_links ( "nightly" , name, extension)
218
+ generate_standalone_links ( "rust" , " nightly", name, extension)
219
219
} else {
220
220
String :: new ( )
221
221
} ;
@@ -242,18 +242,18 @@ impl Blacksmith {
242
242
writeln ! ( buffer, "--------|----------------------" ) . unwrap ( ) ;
243
243
244
244
for & channel in CHANNELS {
245
- let display = if channel == "stable" {
246
- format ! ( "stable ({})" , self . stable_version. as_ref( ) . unwrap( ) )
245
+ if channel == "stable" {
246
+ let stable_version = self . stable_version . as_ref ( ) . unwrap ( ) ;
247
+ writeln ! ( buffer, "stable ({}) | {}" ,
248
+ stable_version,
249
+ generate_standalone_links( "rustc" , stable_version, "src" , "tar.gz" )
250
+ ) . unwrap ( ) ;
247
251
} else {
248
- channel. into ( )
249
- } ;
250
-
251
- writeln ! (
252
- buffer,
253
- "{display} | {links}" ,
254
- display = display,
255
- links = generate_standalone_links( & channel, "src" , "tar.gz" )
256
- ) . unwrap ( ) ;
252
+ writeln ! ( buffer, "{} | {}" ,
253
+ channel,
254
+ generate_standalone_links( "rustc" , & channel, "src" , "tar.gz" )
255
+ ) . unwrap ( ) ;
256
+ }
257
257
}
258
258
259
259
buffer
@@ -262,12 +262,13 @@ impl Blacksmith {
262
262
263
263
/// Generates links to standalone installers provided a rust version or channel,
264
264
/// target name, and file extension.
265
- fn generate_standalone_links ( stem : & str , name : & str , extension : & str ) -> String {
265
+ fn generate_standalone_links ( base : & str , stem : & str , name : & str , extension : & str ) -> String {
266
266
let url = format ! (
267
- "https://static.rust-lang.org/dist/rust -{stem}-{name}.{extension}" ,
267
+ "https://static.rust-lang.org/dist/{base} -{stem}-{name}.{extension}" ,
268
268
extension = extension,
269
269
name = name,
270
270
stem = stem,
271
+ base = base,
271
272
) ;
272
273
273
274
format ! (
0 commit comments