lanzaboote/rust/lanzatool/src/utils.rs

10 lines
287 B
Rust
Raw Normal View History

2022-11-25 09:46:33 -05:00
use std::path::Path;
// All Linux file paths should be convertable to strings
pub fn path_to_string(path: impl AsRef<Path>) -> String {
String::from(path.as_ref().to_str().expect(&format!(
"Failed to convert path '{}' to a string",
path.as_ref().display()
)))
}