Skip to content
/ rust Public
forked from rust-lang/rust

Commit a7f84e9

Browse files
committed
applease clippy
1 parent 2af3ba9 commit a7f84e9

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/bootstrap/src/core/build_steps/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ impl Step for RustAnalyzer {
344344
.config
345345
.tools
346346
.as_ref()
347-
.map_or(true, |tools| tools.iter().any(|tool| tool == "rust-analyzer")),
347+
.is_none_or(|tools| tools.iter().any(|tool| tool == "rust-analyzer")),
348348
)
349349
}
350350

src/bootstrap/src/core/build_steps/compile.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1673,10 +1673,10 @@ impl Step for Sysroot {
16731673
];
16741674
let ci_rustc_dir = builder.config.ci_rustc_dir();
16751675
builder.cp_link_filtered(&ci_rustc_dir, &sysroot, &|path| {
1676-
if path.extension().map_or(true, |ext| !filtered_extensions.contains(&ext)) {
1676+
if path.extension().is_none_or(|ext| !filtered_extensions.contains(&ext)) {
16771677
return true;
16781678
}
1679-
if !path.parent().map_or(true, |p| p.ends_with(&suffix)) {
1679+
if !path.parent().is_none_or(|p| p.ends_with(&suffix)) {
16801680
return true;
16811681
}
16821682
if !filtered_files.iter().all(|f| f != path.file_name().unwrap()) {

src/bootstrap/src/core/build_steps/dist.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn should_build_extended_tool(builder: &Builder<'_>, tool: &str) -> bool {
4747
if !builder.config.extended {
4848
return false;
4949
}
50-
builder.config.tools.as_ref().map_or(true, |tools| tools.contains(tool))
50+
builder.config.tools.as_ref().is_none_or(|tools| tools.contains(tool))
5151
}
5252

5353
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
@@ -410,7 +410,7 @@ impl Step for Rustc {
410410
.config
411411
.tools
412412
.as_ref()
413-
.map_or(true, |tools| tools.iter().any(|tool| tool == "rustdoc"))
413+
.is_none_or(|tools| tools.iter().any(|tool| tool == "rustdoc"))
414414
{
415415
let rustdoc = builder.rustdoc(compiler);
416416
builder.install(&rustdoc, &image.join("bin"), 0o755);

src/bootstrap/src/core/build_steps/install.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ impl Step for Src {
307307

308308
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
309309
let config = &run.builder.config;
310-
let cond = config.extended && config.tools.as_ref().map_or(true, |t| t.contains("src"));
310+
let cond = config.extended && config.tools.as_ref().is_none_or(|t|t.contains("src"));
311311
run.path("src").default_condition(cond)
312312
}
313313

src/bootstrap/src/core/builder/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ impl<'a> Builder<'a> {
14431443
let mut stack = self.stack.borrow_mut();
14441444
for stack_step in stack.iter() {
14451445
// should skip
1446-
if stack_step.downcast_ref::<S>().map_or(true, |stack_step| *stack_step != step) {
1446+
if stack_step.downcast_ref::<S>().is_none_or(|stack_step| *stack_step != step) {
14471447
continue;
14481448
}
14491449
let mut out = String::new();

src/bootstrap/src/core/config/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ impl<'de> Deserialize<'de> for LldMode {
11251125
match v {
11261126
"external" => Ok(LldMode::External),
11271127
"self-contained" => Ok(LldMode::SelfContained),
1128-
_ => Err(E::custom("unknown mode {v}")),
1128+
_ => Err(E::custom(format!("unknown mode {v}"))),
11291129
}
11301130
}
11311131
}

0 commit comments

Comments
 (0)