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

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-08-19 15:27:24 +02:00 committed by GitHub
parent 9e8ec72bd5
commit 8f567383e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
281 changed files with 6628 additions and 7089 deletions

View file

@ -167,15 +167,14 @@ fn main() {
continue;
}
if let Some(language) = meta.language_server {
if !languages.contains(&language.file_extension) {
if let Some(language) = meta.language_server
&& !languages.contains(&language.file_extension) {
panic!(
"Eval for {:?} could not be run because no language server was found for extension {:?}",
meta.name,
language.file_extension
);
}
}
// TODO: This creates a worktree per repetition. Ideally these examples should
// either be run sequentially on the same worktree, or reuse worktrees when there

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");

View file

@ -376,11 +376,10 @@ impl ExampleInstance {
);
let result = this.thread.conversation(&mut example_cx).await;
if let Err(err) = result {
if !err.is::<FailedAssertion>() {
if let Err(err) = result
&& !err.is::<FailedAssertion>() {
return Err(err);
}
}
println!("{}Stopped", this.log_prefix);