use let-else where the match only guarded an exit

This commit is contained in:
2026-09-21 01:18:07 +03:00
parent 72f24b7369
commit 7c577eafd7
3 changed files with 9 additions and 16 deletions
+3 -7
View File
@@ -300,9 +300,8 @@ impl CodecAvailability {
}
pub(crate) fn codec_availability(ffmpeg: &Path) -> CodecAvailability {
let encoders = match list_encoders(ffmpeg) {
Ok(set) => set,
Err(_) => return CodecAvailability::all_unknown(),
let Ok(encoders) = list_encoders(ffmpeg) else {
return CodecAvailability::all_unknown();
};
CodecAvailability {
h264: encoders.contains(mp4_video_codec(Mp4Codec::H264)),
@@ -442,10 +441,7 @@ fn two_pass_video(
}
fn cleanup_pass_logs(stem: &Path) {
let parent = match stem.parent() {
Some(p) => p,
None => return,
};
let Some(parent) = stem.parent() else { return };
let prefix = stem.file_name().and_then(OsStr::to_str).unwrap_or("");
if prefix.is_empty() {
return;