From c58386012623d6f3940f28451d2e7088bce6ae58 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sun, 14 Feb 2021 11:31:35 -0500 Subject: [PATCH] Remove unnecessary `Option` in `default_doc` Previously, there two different ways to encode the same info: `None` or `Some(&[])`. Now there is only one way, `&[]`. --- src/bootstrap/builder.rs | 3 +-- src/bootstrap/dist.rs | 4 ++-- src/bootstrap/test.rs | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index f1a160250dbe1..186526eefc768 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -561,8 +561,7 @@ impl<'a> Builder<'a> { self.run_step_descriptions(&Builder::get_step_descriptions(self.kind), &self.paths); } - pub fn default_doc(&self, paths: Option<&[PathBuf]>) { - let paths = paths.unwrap_or(&[]); + pub fn default_doc(&self, paths: &[PathBuf]) { self.run_step_descriptions(&Builder::get_step_descriptions(Kind::Doc), paths); } diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index af9c0fb04bc9d..62a8fc3505a55 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -68,7 +68,7 @@ impl Step for Docs { if !builder.config.docs { return None; } - builder.default_doc(None); + builder.default_doc(&[]); let dest = "share/doc/rust/html"; @@ -103,7 +103,7 @@ impl Step for RustcDocs { if !builder.config.compiler_docs { return None; } - builder.default_doc(None); + builder.default_doc(&[]); let mut tarball = Tarball::new(builder, "rustc-docs", &host.triple); tarball.set_product_name("Rustc Documentation"); diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index d9132f20d85b3..7830dc8239464 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -111,7 +111,7 @@ impl Step for Linkcheck { builder.info(&format!("Linkcheck ({})", host)); - builder.default_doc(None); + builder.default_doc(&[]); let _time = util::timeit(&builder); try_run(