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 f1a160250db..186526eefc7 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -561,8 +561,7 @@ pub fn execute_cli(&self) { 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 af9c0fb04bc..62a8fc3505a 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -68,7 +68,7 @@ fn run(self, builder: &Builder<'_>) -> Option { if !builder.config.docs { return None; } - builder.default_doc(None); + builder.default_doc(&[]); let dest = "share/doc/rust/html"; @@ -103,7 +103,7 @@ fn run(self, builder: &Builder<'_>) -> Option { 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 d9132f20d85..7830dc82394 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -111,7 +111,7 @@ fn run(self, builder: &Builder<'_>) { builder.info(&format!("Linkcheck ({})", host)); - builder.default_doc(None); + builder.default_doc(&[]); let _time = util::timeit(&builder); try_run(