use let-else where the match only guarded an exit
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user