Convert configuration to CDDesc

This commit is contained in:
2022-11-08 21:28:05 +01:00
parent 852c908a70
commit 1b0fc42e84
6 changed files with 70 additions and 12 deletions

View File

@@ -134,4 +134,15 @@ pub fn input_to_vec(input: Input) -> Result<Vec<u8>, Error> {
}
Ok(data)
}
pub fn read_file(file_path: PathBuf) -> Result<Vec<u8>, Error> {
match std::fs::read(&file_path) {
Ok(data) => {
Ok(data)
},
Err(error) => {
Err(Error::from_text(format!("Failed reading file {} with error: \"{}\"", file_path.display(), error)))
}
}
}