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);
.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)]
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);
}
}
.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);
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)
}
}
) -> Vec<SanitizerRuntime> {
let darwin_libs = |os: &str, components: &[&str]| -> Vec<SanitizerRuntime> {
components
- .into_iter()
+ .iter()
.map(move |c| SanitizerRuntime {
cmake_target: format!("clang_rt.{}_{}_dynamic", c, os),
path: out_dir
let common_libs = |os: &str, arch: &str, components: &[&str]| -> Vec<SanitizerRuntime> {
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)),