Skip to content

Commit b2a2c79

Browse files
committed
fix formatting
1 parent a9ce13b commit b2a2c79

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

src/docbuilder/rustwide_builder.rs

+24-25
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,14 @@ impl RustwideBuilder {
280280
build.host_source_dir(),
281281
)?);
282282

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() {
287284
let host_target = build.host_target_dir();
288-
if host_target.join(&res.target)
285+
if host_target
286+
.join(&res.target)
289287
.join("doc")
290288
.join(&name)
291-
.is_dir() {
289+
.is_dir()
290+
{
292291
has_docs = true;
293292
in_target = true;
294293
// hack for proc-macro documentation:
@@ -313,7 +312,13 @@ impl RustwideBuilder {
313312
// Then build the documentation for all the targets
314313
for target in TARGETS {
315314
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+
)?;
317322
}
318323
}
319324
self.upload_docs(&conn, name, version, local_storage.path())?;
@@ -349,24 +354,22 @@ impl RustwideBuilder {
349354
Ok(res.successful)
350355
}
351356

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<()> {
354365
let target_res = self.execute_build(Some(target), build, limits)?;
355366
if target_res.successful {
356367
// Cargo is not giving any error and not generating documentation of some crates
357368
// when we use a target compile options. Check documentation exists before
358369
// adding target to successfully_targets.
359370
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)?;
370373
successful_targets.push(target.to_string());
371374
}
372375
}
@@ -406,11 +409,7 @@ impl RustwideBuilder {
406409
if let Some(package_rustdoc_args) = &metadata.rustdoc_args {
407410
rustdoc_flags.append(&mut package_rustdoc_args.iter().map(|s| s.to_owned()).collect());
408411
}
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()];
414413
if let Some(explicit_target) = target {
415414
cargo_args.push("--target".to_owned());
416415
cargo_args.push(explicit_target.to_owned());
@@ -440,7 +439,7 @@ impl RustwideBuilder {
440439
.rustc_args
441440
.as_ref()
442441
.map(|args| args.join(" "))
443-
.unwrap_or_default()
442+
.unwrap_or_default(),
444443
)
445444
.env("RUSTDOCFLAGS", rustdoc_flags.join(" "))
446445
.args(&cargo_args)

0 commit comments

Comments
 (0)