Run cargo fmt/fix

This commit is contained in:
Cameron
2025-12-23 22:07:50 -05:00
parent 3a64b30621
commit 6dbac6f22f
8 changed files with 43 additions and 52 deletions

View File

@@ -37,7 +37,7 @@ pub fn get_canonical_extension(mime_type: &str) -> String {
"video/quicktime" => "mov",
// Fallback: use the last part of MIME type
_ => mime_type.split('/').last().unwrap_or("unknown"),
_ => mime_type.split('/').next_back().unwrap_or("unknown"),
}
.to_string()
}

View File

@@ -110,11 +110,10 @@ fn find_file_with_alternative_extension(
let test_path = parent.join(format!("{}.{}", stem, ext));
if test_path.exists() {
// Convert back to relative path
if let Ok(rel) = test_path.strip_prefix(base_path) {
if let Some(rel_str) = rel.to_str() {
if let Ok(rel) = test_path.strip_prefix(base_path)
&& let Some(rel_str) = rel.to_str() {
return Some(rel_str.to_string());
}
}
}
}

View File

@@ -98,7 +98,7 @@ pub fn validate_file_types(
true
} else {
// Interactive prompt
match prompt_for_rename(&new_relative_path) {
match prompt_for_rename(new_relative_path) {
RenameDecision::Yes => true,
RenameDecision::No => {
user_skipped += 1;
@@ -183,8 +183,8 @@ pub fn validate_file_types(
/// Check if a file is a supported media file based on extension
fn is_supported_media_file(path: &Path) -> bool {
if let Some(ext) = path.extension() {
if let Some(ext_str) = ext.to_str() {
if let Some(ext) = path.extension()
&& let Some(ext_str) = ext.to_str() {
let ext_lower = ext_str.to_lowercase();
return matches!(
ext_lower.as_str(),
@@ -202,7 +202,6 @@ fn is_supported_media_file(path: &Path) -> bool {
| "mov"
);
}
}
false
}