Auto-fix clippy::collapsible_if violations (#36428)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz
2025-08-19 13:27:24 +00:00
committed by GitHub
parent 9e8ec72bd5
commit 8f567383e4
281 changed files with 6625 additions and 7086 deletions
+13 -15
View File
@@ -46,27 +46,25 @@ fn find_target_files_recursive(
max_depth,
found_files,
)?;
} else if path.is_file() {
if let Some(filename_osstr) = path.file_name() {
if let Some(filename_str) = filename_osstr.to_str() {
if filename_str == target_filename {
found_files.push(path);
}
}
}
} else if path.is_file()
&& let Some(filename_osstr) = path.file_name()
&& let Some(filename_str) = filename_osstr.to_str()
&& filename_str == target_filename
{
found_files.push(path);
}
}
Ok(())
}
pub fn generate_explorer_html(input_paths: &[PathBuf], output_path: &PathBuf) -> Result<String> {
if let Some(parent) = output_path.parent() {
if !parent.exists() {
fs::create_dir_all(parent).context(format!(
"Failed to create output directory: {}",
parent.display()
))?;
}
if let Some(parent) = output_path.parent()
&& !parent.exists()
{
fs::create_dir_all(parent).context(format!(
"Failed to create output directory: {}",
parent.display()
))?;
}
let template_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("src/explorer.html");