script_helpers/
must_open_file.rs

1use std::{fs::File, path::Path, process::exit};
2
3pub fn must_open_file(file_path: &Path) -> File {
4    let Ok(file) = File::open(file_path) else {
5        eprintln!(
6            "Could not find file to hash: {}",
7            file_path.to_string_lossy()
8        );
9        exit(1);
10    };
11    file
12}