Skip to content

Commit e3a4b16

Browse files
committed
Auto merge of rust-lang#75792 - matthiaskrgr:bootstrap_clippy, r=Dylan-DPC
bootstrap: fix a couple of clippy lint warnings clippy::print_literal clippy::clone_on_copy clippy::single_char_pattern clippy::into_iter_on_ref clippy::match_like_matches_macro
2 parents e674422 + 108a3f8 commit e3a4b16

File tree

6 files changed

+8
-14
lines changed

6 files changed

+8
-14
lines changed

src/bootstrap/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ impl Config {
527527

528528
let build = toml.build.clone().unwrap_or_default();
529529
// set by bootstrap.py
530-
config.hosts.push(config.build.clone());
530+
config.hosts.push(config.build);
531531
for host in build.host.iter().map(|h| TargetSelection::from_user(h)) {
532532
if !config.hosts.contains(&host) {
533533
config.hosts.push(host);

src/bootstrap/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn is_explicit_request(builder: &Builder<'_>, path: &str) -> bool {
9696
.paths
9797
.iter()
9898
.map(components_simplified)
99-
.any(|requested| requested.iter().copied().eq(path.split("/")))
99+
.any(|requested| requested.iter().copied().eq(path.split('/')))
100100
}
101101

102102
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]

src/bootstrap/flags.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -505,14 +505,11 @@ Arguments:
505505

506506
if let Subcommand::Check { .. } = &cmd {
507507
if matches.opt_str("stage").is_some() {
508-
println!("{}", "--stage not supported for x.py check, always treated as stage 0");
508+
println!("--stage not supported for x.py check, always treated as stage 0");
509509
process::exit(1);
510510
}
511511
if matches.opt_str("keep-stage").is_some() {
512-
println!(
513-
"{}",
514-
"--keep-stage not supported for x.py check, only one stage available"
515-
);
512+
println!("--keep-stage not supported for x.py check, only one stage available");
516513
process::exit(1);
517514
}
518515
}

src/bootstrap/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub fn format(build: &Build, check: bool) {
8787
.lines()
8888
.filter(|entry| entry.starts_with("??"))
8989
.map(|entry| {
90-
entry.split(" ").nth(1).expect("every git status entry should list a path")
90+
entry.split(' ').nth(1).expect("every git status entry should list a path")
9191
});
9292
for untracked_path in untracked_paths {
9393
eprintln!("skip untracked path {} during rustfmt invocations", untracked_path);

src/bootstrap/lib.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,7 @@ pub enum Mode {
323323

324324
impl Mode {
325325
pub fn is_tool(&self) -> bool {
326-
match self {
327-
Mode::ToolBootstrap | Mode::ToolRustc | Mode::ToolStd => true,
328-
_ => false,
329-
}
326+
matches!(self, Mode::ToolBootstrap | Mode::ToolRustc | Mode::ToolStd)
330327
}
331328
}
332329

src/bootstrap/native.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ fn supported_sanitizers(
767767
) -> Vec<SanitizerRuntime> {
768768
let darwin_libs = |os: &str, components: &[&str]| -> Vec<SanitizerRuntime> {
769769
components
770-
.into_iter()
770+
.iter()
771771
.map(move |c| SanitizerRuntime {
772772
cmake_target: format!("clang_rt.{}_{}_dynamic", c, os),
773773
path: out_dir
@@ -779,7 +779,7 @@ fn supported_sanitizers(
779779

780780
let common_libs = |os: &str, arch: &str, components: &[&str]| -> Vec<SanitizerRuntime> {
781781
components
782-
.into_iter()
782+
.iter()
783783
.map(move |c| SanitizerRuntime {
784784
cmake_target: format!("clang_rt.{}-{}", c, arch),
785785
path: out_dir.join(&format!("build/lib/{}/libclang_rt.{}-{}.a", os, c, arch)),

0 commit comments

Comments
 (0)