apply clippy::or_fun_call

This commit is contained in:
klensy 2025-06-17 13:59:53 +03:00
parent 55d436467c
commit 8c83935cdf
13 changed files with 32 additions and 28 deletions

View file

@ -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.

View file

@ -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