You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: filesystem.rs
    path of file: ./repos/dotter/src
    
    the code of the file until where you have to start completion: use anyhow::{Context, Result};

use serde::de::DeserializeOwned;
use serde::ser::Serialize;

use std::collections::BTreeMap;
use std::fs::{self, File};
use std::io::{self, ErrorKind, Read};
use std::path::{Path, PathBuf};
#[cfg(unix)]
use std::process::Command;

use crate::config::UnixUser;

// === Serialize/deserialize files ==
    
    fn create_dir_all(&mut self, path: &Path, owner: &Option<UnixUser>) -> Result<()> {
        if let Some(owner) = owner {
            let success = self
                .sudo(format!(
                    "Creating directory {:?} from user {:?}...",
                    path, owner
                ))
                .arg("-u")
                .arg(owner.as_sudo_arg())
                .arg("mkdir")
                .arg("-p")
                .arg(path)
                .spawn()
                .context("spawn sudo mkdir")?
                .wait()
                .context("wait for sudo mkdir")?
                .success();

            anyhow::ensure!(success, "sudo mkdir failed");
        } else {
            debug!("Creating directory {:?} as current user...", path);
            std::fs::create_dir_all(path).context("create directories")?;
        }
        Ok(())
    }