Skip to content

Commit

Permalink
feat: add file reading helper
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverNChalk committed Nov 25, 2024
1 parent 9cf9698 commit 0627957
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/fs.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use std::path::Path;

pub fn must_read(path: &Path) -> Vec<u8> {
std::fs::read(path)
.unwrap_or_else(|err| panic!("Failed to read provided file; err={err}; path={path:?}"))
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod fs;
#[cfg(feature = "tracing")]
pub mod tracing;
#[cfg(feature = "version")]
Expand Down

0 comments on commit 0627957

Please sign in to comment.