11 lines
251 B
Rust
11 lines
251 B
Rust
use std::path::Path;
|
|
|
|
/// Create directory if missing
|
|
pub fn create_directory_if_missing<P: AsRef<Path>>(path: P) -> anyhow::Result<()> {
|
|
let path = path.as_ref();
|
|
if !path.exists() {
|
|
std::fs::create_dir_all(path)?;
|
|
}
|
|
Ok(())
|
|
}
|