diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-10-07 13:56:20 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-10-07 13:56:20 +0200 |
| commit | b70bc1d6433fc0001336c968465fbe653921491c (patch) | |
| tree | 17be596f5c512538000bccedfb2d47adfaf3da83 /src/archiver | |
| parent | e953c7890abcbe6dfc612d4b307a7238cb2bb93c (diff) | |
Apply formatting
Diffstat (limited to 'src/archiver')
| -rw-r--r-- | src/archiver/mod.rs | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/src/archiver/mod.rs b/src/archiver/mod.rs index a0655a4..b83f2ef 100644 --- a/src/archiver/mod.rs +++ b/src/archiver/mod.rs @@ -74,26 +74,21 @@ fn read_archive(archive_directory: &PathBuf) -> Vec<ArchiveEntry> { for entry in entries.filter_map(Result::ok) { let entry_path = entry.path(); let post_id = entry.file_name(); - if let Ok(entry_type) = entry.file_type() { - if entry_type.is_dir() { - if let Ok(candidates) = read_dir(&entry_path) { - for candidate in candidates.filter_map(Result::ok) { - let candidate_path = candidate.path(); - if let Some(extension) = candidate_path.extension() { - if extension == "gmi" { - if let Some(slug) = candidate_path.file_stem() { - if let (Some(post_id), Some(slug)) = - (post_id.to_str(), slug.to_str()) - { - archive_entries.push(ArchiveEntry { - id: post_id.to_string(), - slug: slug.to_string(), - }); - } - } - } - } - } + if let Ok(entry_type) = entry.file_type() + && entry_type.is_dir() + && let Ok(candidates) = read_dir(&entry_path) + { + for candidate in candidates.filter_map(Result::ok) { + let candidate_path = candidate.path(); + if let Some(extension) = candidate_path.extension() + && extension == "gmi" + && let Some(slug) = candidate_path.file_stem() + && let (Some(post_id), Some(slug)) = (post_id.to_str(), slug.to_str()) + { + archive_entries.push(ArchiveEntry { + id: post_id.to_string(), + slug: slug.to_string(), + }); } } } |