diff options
| author | klensy <klensy@users.noreply.github.com> | 2025-06-17 13:59:53 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2025-06-17 13:59:53 +0300 |
| commit | 8c83935cdf87d4e3c0d9e7796fc810fb54ecbf39 (patch) | |
| tree | b1c85aae31c3fcadcb2f0be6457f7cf87c494e23 /src/tools/compiletest | |
| parent | 55d436467c351b56253deeba209ae2553d1c243f (diff) | |
| download | rust-8c83935cdf87d4e3c0d9e7796fc810fb54ecbf39.tar.gz rust-8c83935cdf87d4e3c0d9e7796fc810fb54ecbf39.zip | |
apply clippy::or_fun_call
Diffstat (limited to 'src/tools/compiletest')
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 3 | ||||
| -rw-r--r-- | src/tools/compiletest/src/runtest/coverage.rs | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 75f24adb70f..e9b8b6bda3f 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2368,7 +2368,8 @@ impl<'test> TestCx<'test> { // Real paths into the libstd/libcore let rust_src_dir = &self.config.sysroot_base.join("lib/rustlib/src/rust"); rust_src_dir.try_exists().expect(&*format!("{} should exists", rust_src_dir)); - let rust_src_dir = rust_src_dir.read_link_utf8().unwrap_or(rust_src_dir.to_path_buf()); + let rust_src_dir = + rust_src_dir.read_link_utf8().unwrap_or_else(|_| rust_src_dir.to_path_buf()); normalize_path(&rust_src_dir.join("library"), "$SRC_DIR_REAL"); // eg. diff --git a/src/tools/compiletest/src/runtest/coverage.rs b/src/tools/compiletest/src/runtest/coverage.rs index 41cfeaee35f..38f0e956474 100644 --- a/src/tools/compiletest/src/runtest/coverage.rs +++ b/src/tools/compiletest/src/runtest/coverage.rs @@ -357,9 +357,9 @@ impl<'test> TestCx<'test> { // Add this line to the current subview. subviews .last_mut() - .ok_or(format!( - "unexpected subview line outside of a subview on line {line_num}" - ))? + .ok_or_else(|| { + format!("unexpected subview line outside of a subview on line {line_num}") + })? .push(line); } else { // This line is not part of a subview, so sort and print any |
