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: build.rs
    path of file: ./repos/paperclip/src/build
    
    the code of the file until where you have to start completion: use std::{
    env,
    fmt::Write as _,
    fs::File,
    io::{Read, Write},
    path::PathBuf,
};

fn load_file(p: PathBuf) -> String {
    let mut string = String::new();
    let mut fd = File::open(p).unwrap();
    fd.read_to_string(&mut string).unwrap();
    string
}

fn main() {
    let out_dir = env::var("OUT_DIR").unwrap();
    let root = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
    let files = &[
        ("CARGO_MANIFEST", "src/build/manifest.hbs"),
        ("CLIENT_MOD", "src/build/client_mod.hbs"),
        ("CLAP_YAML", "src/build/clap_yaml.hbs"),
        ("CLI_MAIN", "src/build/cli_main.hbs"),
        ("UTIL_MOD", "src/build/util_mod.hbs"),
        ("CLI_UTIL", "src/build/cli_util.hbs"),
    ];

    let mut contents = String::from(
        "
#[cfg(feature = \"codegen\")]
mod template {
    use tinytemplate::TinyTemplate;

    #[derive(Debug, Copy, Clone)]
    #[allow(dead_code, non_camel_case_types)]
    pub enum Template {",
    );

    for (name, _) in files {
     
    
fn main() {
    let out_dir = env::var("OUT_DIR").unwrap();
    let root = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
    let files = &[
        ("CARGO_MANIFEST", "src/build/manifest.hbs"),
        ("CLIENT_MOD", "src/build/client_mod.hbs"),
        ("CLAP_YAML", "src/build/clap_yaml.hbs"),
        ("CLI_MAIN", "src/build/cli_main.hbs"),
        ("UTIL_MOD", "src/build/util_mod.hbs"),
        ("CLI_UTIL", "src/build/cli_util.hbs"),
    ];

    let mut contents = String::from(
        "
#[cfg(feature = \"codegen\")]
mod template {
    use tinytemplate::TinyTemplate;

    #[derive(Debug, Copy, Clone)]
    #[allow(dead_code, non_camel_case_types)]
    pub enum Template {",
    );

    for (name, _) in files {
        contents.push_str(
            "
        ",
        );
        contents.push_str(name);
        contents.push(',');
    }

    contents.push_str(
        "
    }",
    );

    let source_path = PathBuf::from(&out_dir).join("template.rs");
    for (name, file) in files {
        println!("cargo:rerun-if-changed={}", file);
        let thing = load_file(root.join(file));
        let _ = &write!(
            contents,
            "
    pub const {}: &str = {:?};
",
            name, thing
        );
    }

    contents.push_str(
        "
    pub fn render<C>(t: Template, context: &C) -> tinytemplate::error::Result<String>
        where C: serde::Serialize
    {
        let mut temp = TinyTemplate::new();
        temp.add_template(\"file\", match t {",
    );

    for (name, _) in files {
        let _ = &write!(
            contents,
            "
            Template::{name} => {name},",
            name = name
        );
    }

    contents.push_str(
        "
        })?;

        temp.render(\"file\", context)
    }
}
",
    );

    let mut fd = File::create(source_path).unwrap();
    fd.write_all(contents.as_bytes()).unwrap();
}