pub fn ensure_dir_exists(
dir: &Path,
mkdir: impl FnMut(&Path) -> Result<(), Error>,
) -> Result<(), Error>Expand description
Ported from ensureDirExists. mkdir is a parameter so tests can
model the host filesystem, same as the Go version’s injected mkdir func(string, os.FileMode) error.