10 lines
250 B
Rust
10 lines
250 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(())
|
||
|
}
|