Skip to content

Commit 6a83f54

Browse files
fix: replace unwrap() with descriptive error messages in dynamic_linking (#149)
1 parent 8050eba commit 6a83f54

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

build.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,12 @@ fn dynamic_linking(env_vars: EnvVars) {
417417
stem.trim_start_matches("lib")
418418
}
419419
})
420-
.unwrap()
420+
.expect("FFMPEG_DLL_PATH does not point to a valid file. Ensure the path includes a filename.")
421421
.to_string(),
422-
ffmpeg_dll_path.parent().unwrap().to_path_buf(),
422+
ffmpeg_dll_path
423+
.parent()
424+
.expect("FFMPEG_DLL_PATH has no parent directory. Please provide a full path including the directory.")
425+
.to_path_buf(),
423426
);
424427
linking_with_single_lib(&lib_name, &ffmpeg_dll_dir, FFmpegLinkMode::Dynamic);
425428
}

0 commit comments

Comments
 (0)