Collapse the IWD fallback read condition

Address the only added clippy warning in fork Actions run 36914579707; preserve name matching before the read and fallback after its error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bulat Fatykh
2026-10-01 22:40:19 +03:00
parent 0d8c5c7a15
commit 9eedca78a6
+4 -4
View File
@@ -456,10 +456,10 @@ pub fn read_iwd_named(games_root: &Path, want: &str) -> Option<Vec<u8>> {
let Ok(mut entry) = archive.by_index(index) else {
continue;
};
if entry.name().replace('\\', "/").eq_ignore_ascii_case(&want) {
if let Ok(bytes) = read_entry_bytes(&mut entry, None) {
return Some(bytes);
}
if entry.name().replace('\\', "/").eq_ignore_ascii_case(&want)
&& let Ok(bytes) = read_entry_bytes(&mut entry, None)
{
return Some(bytes);
}
}
}