Cargo fmt

This commit is contained in:
Cameron
2025-12-18 21:20:31 -05:00
parent aaf9cc64be
commit b4c5a38c9d
5 changed files with 32 additions and 23 deletions

View File

@@ -1,9 +1,8 @@
use crate::cleanup::database_updater::DatabaseUpdater;
use crate::cleanup::file_type_detector::{detect_file_type, should_rename};
use crate::cleanup::types::{CleanupConfig, CleanupStats};
use anyhow::{Context, Result};
use dialoguer::Confirm;
use log::{error, info, warn};
use anyhow::Result;
use log::{error, warn};
use std::fs;
use std::path::{Path, PathBuf};
use walkdir::WalkDir;
@@ -79,10 +78,7 @@ pub fn validate_file_types(
// Check if destination already exists
if new_file_path.exists() {
warn!(
"✗ Destination already exists: {}",
new_relative_path
);
warn!("✗ Destination already exists: {}", new_relative_path);
stats.add_error(format!(
"Destination exists for {}: {}",
relative_path, new_relative_path
@@ -127,8 +123,7 @@ pub fn validate_file_types(
println!("✓ Renamed file");
// Update database
match db_updater
.update_file_path(relative_path, new_relative_path)
match db_updater.update_file_path(relative_path, new_relative_path)
{
Ok(_) => {
files_renamed += 1;
@@ -148,7 +143,10 @@ pub fn validate_file_types(
}
Err(e) => {
error!("✗ Failed to rename file: {:?}", e);
stats.add_error(format!("Rename failed for {}: {}", relative_path, e));
stats.add_error(format!(
"Rename failed for {}: {}",
relative_path, e
));
}
}
}
@@ -190,7 +188,8 @@ fn is_supported_media_file(path: &Path) -> bool {
let ext_lower = ext_str.to_lowercase();
return matches!(
ext_lower.as_str(),
"jpg" | "jpeg"
"jpg"
| "jpeg"
| "png"
| "webp"
| "tiff"