@@ -280,15 +280,14 @@ impl RustwideBuilder {
280
280
build. host_source_dir ( ) ,
281
281
) ?) ;
282
282
283
- if let Some ( name) = res
284
- . cargo_metadata
285
- . root ( )
286
- . library_name ( ) {
283
+ if let Some ( name) = res. cargo_metadata . root ( ) . library_name ( ) {
287
284
let host_target = build. host_target_dir ( ) ;
288
- if host_target. join ( & res. target )
285
+ if host_target
286
+ . join ( & res. target )
289
287
. join ( "doc" )
290
288
. join ( & name)
291
- . is_dir ( ) {
289
+ . is_dir ( )
290
+ {
292
291
has_docs = true ;
293
292
in_target = true ;
294
293
// hack for proc-macro documentation:
@@ -313,7 +312,13 @@ impl RustwideBuilder {
313
312
// Then build the documentation for all the targets
314
313
for target in TARGETS {
315
314
debug ! ( "building package {} {} for {}" , name, version, target) ;
316
- self . build_target ( target, & build, & limits, & local_storage. path ( ) , & mut successful_targets) ?;
315
+ self . build_target (
316
+ target,
317
+ & build,
318
+ & limits,
319
+ & local_storage. path ( ) ,
320
+ & mut successful_targets,
321
+ ) ?;
317
322
}
318
323
}
319
324
self . upload_docs ( & conn, name, version, local_storage. path ( ) ) ?;
@@ -349,24 +354,22 @@ impl RustwideBuilder {
349
354
Ok ( res. successful )
350
355
}
351
356
352
- fn build_target ( & self , target : & str , build : & Build , limits : & Limits ,
353
- local_storage : & Path , successful_targets : & mut Vec < String > ) -> Result < ( ) > {
357
+ fn build_target (
358
+ & self ,
359
+ target : & str ,
360
+ build : & Build ,
361
+ limits : & Limits ,
362
+ local_storage : & Path ,
363
+ successful_targets : & mut Vec < String > ,
364
+ ) -> Result < ( ) > {
354
365
let target_res = self . execute_build ( Some ( target) , build, limits) ?;
355
366
if target_res. successful {
356
367
// Cargo is not giving any error and not generating documentation of some crates
357
368
// when we use a target compile options. Check documentation exists before
358
369
// adding target to successfully_targets.
359
370
if build. host_target_dir ( ) . join ( target) . join ( "doc" ) . is_dir ( ) {
360
- debug ! (
361
- "adding documentation for target {} to the database" ,
362
- target,
363
- ) ;
364
- self . copy_docs (
365
- & build. host_target_dir ( ) ,
366
- local_storage,
367
- target,
368
- false ,
369
- ) ?;
371
+ debug ! ( "adding documentation for target {} to the database" , target, ) ;
372
+ self . copy_docs ( & build. host_target_dir ( ) , local_storage, target, false ) ?;
370
373
successful_targets. push ( target. to_string ( ) ) ;
371
374
}
372
375
}
@@ -406,11 +409,7 @@ impl RustwideBuilder {
406
409
if let Some ( package_rustdoc_args) = & metadata. rustdoc_args {
407
410
rustdoc_flags. append ( & mut package_rustdoc_args. iter ( ) . map ( |s| s. to_owned ( ) ) . collect ( ) ) ;
408
411
}
409
- let mut cargo_args = vec ! [
410
- "doc" . to_owned( ) ,
411
- "--lib" . to_owned( ) ,
412
- "--no-deps" . to_owned( ) ,
413
- ] ;
412
+ let mut cargo_args = vec ! [ "doc" . to_owned( ) , "--lib" . to_owned( ) , "--no-deps" . to_owned( ) ] ;
414
413
if let Some ( explicit_target) = target {
415
414
cargo_args. push ( "--target" . to_owned ( ) ) ;
416
415
cargo_args. push ( explicit_target. to_owned ( ) ) ;
@@ -440,7 +439,7 @@ impl RustwideBuilder {
440
439
. rustc_args
441
440
. as_ref ( )
442
441
. map ( |args| args. join ( " " ) )
443
- . unwrap_or_default ( )
442
+ . unwrap_or_default ( ) ,
444
443
)
445
444
. env ( "RUSTDOCFLAGS" , rustdoc_flags. join ( " " ) )
446
445
. args ( & cargo_args)
0 commit comments