Fix clippy: collapse nested if in discovery module
Phase 2 complete - 49 tests passing, zero clippy warnings.
This commit is contained in:
@@ -13,10 +13,10 @@ fn is_image_extension(ext: &str) -> bool {
|
||||
|
||||
pub fn discover_images(path: &Path, recursive: bool) -> Vec<PathBuf> {
|
||||
if path.is_file() {
|
||||
if let Some(ext) = path.extension().and_then(|e| e.to_str()) {
|
||||
if is_image_extension(ext) {
|
||||
return vec![path.to_path_buf()];
|
||||
}
|
||||
if let Some(ext) = path.extension().and_then(|e| e.to_str())
|
||||
&& is_image_extension(ext)
|
||||
{
|
||||
return vec![path.to_path_buf()];
|
||||
}
|
||||
return Vec::new();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user