diff options
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(), + }); } } } |