use crate::EntryWriteError; use std::path::Path; pub fn make_directory
(path: P) -> Result<(), EntryWriteError> where P: AsRef, { std::fs::DirBuilder::new().recursive(true).create(path)?; Ok(()) } pub fn make_parent_directory(path: P) -> Result<(), EntryWriteError> where P: AsRef, { match path.as_ref().parent() { Some(parent) => make_directory(parent), None => Ok(()), } }
(path: P) -> Result<(), EntryWriteError> where P: AsRef, { match path.as_ref().parent() { Some(parent) => make_directory(parent), None => Ok(()), } }