1 2 3 4 5 6 7 8 9
use anyhow::Result; use std::path::Path; pub fn ensure_parent_exists(path: &Path) -> Result<()> { if let Some(parent) = path.parent() { std::fs::create_dir_all(parent)?; } Ok(()) }