diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 70b1c471ac3f0..8b8b01b115327 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -527,7 +527,7 @@ impl Config { let build = toml.build.clone().unwrap_or_default(); // set by bootstrap.py - config.hosts.push(config.build.clone()); + config.hosts.push(config.build); for host in build.host.iter().map(|h| TargetSelection::from_user(h)) { if !config.hosts.contains(&host) { config.hosts.push(host); diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index a1b5ca2ea2fa1..2a8f43950db3c 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -96,7 +96,7 @@ fn is_explicit_request(builder: &Builder<'_>, path: &str) -> bool { .paths .iter() .map(components_simplified) - .any(|requested| requested.iter().copied().eq(path.split("/"))) + .any(|requested| requested.iter().copied().eq(path.split('/'))) } #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs index 56e4f0467cc50..38b3a32e3b5fb 100644 --- a/src/bootstrap/flags.rs +++ b/src/bootstrap/flags.rs @@ -505,14 +505,11 @@ Arguments: if let Subcommand::Check { .. } = &cmd { if matches.opt_str("stage").is_some() { - println!("{}", "--stage not supported for x.py check, always treated as stage 0"); + println!("--stage not supported for x.py check, always treated as stage 0"); process::exit(1); } if matches.opt_str("keep-stage").is_some() { - println!( - "{}", - "--keep-stage not supported for x.py check, only one stage available" - ); + println!("--keep-stage not supported for x.py check, only one stage available"); process::exit(1); } } diff --git a/src/bootstrap/format.rs b/src/bootstrap/format.rs index 390b7e96b9a54..6f93082e6752f 100644 --- a/src/bootstrap/format.rs +++ b/src/bootstrap/format.rs @@ -87,7 +87,7 @@ pub fn format(build: &Build, check: bool) { .lines() .filter(|entry| entry.starts_with("??")) .map(|entry| { - entry.split(" ").nth(1).expect("every git status entry should list a path") + entry.split(' ').nth(1).expect("every git status entry should list a path") }); for untracked_path in untracked_paths { eprintln!("skip untracked path {} during rustfmt invocations", untracked_path); diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 77820ef87e3b4..a42ee11bd6fe5 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -323,10 +323,7 @@ pub enum Mode { impl Mode { pub fn is_tool(&self) -> bool { - match self { - Mode::ToolBootstrap | Mode::ToolRustc | Mode::ToolStd => true, - _ => false, - } + matches!(self, Mode::ToolBootstrap | Mode::ToolRustc | Mode::ToolStd) } } diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index eca9ddceae1b5..97d9dbdd63fb2 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -767,7 +767,7 @@ fn supported_sanitizers( ) -> Vec { let darwin_libs = |os: &str, components: &[&str]| -> Vec { components - .into_iter() + .iter() .map(move |c| SanitizerRuntime { cmake_target: format!("clang_rt.{}_{}_dynamic", c, os), path: out_dir @@ -779,7 +779,7 @@ fn supported_sanitizers( let common_libs = |os: &str, arch: &str, components: &[&str]| -> Vec { components - .into_iter() + .iter() .map(move |c| SanitizerRuntime { cmake_target: format!("clang_rt.{}-{}", c, arch), path: out_dir.join(&format!("build/lib/{}/libclang_rt.{}-{}.a", os, c, arch)),