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: test.rs
    path of file: ./repos/actix-swagger/swagg/src
    
    the code of the file until where you have to start completion: pub fn pretty(input: String) -> String {
    use std::fs::File;
    use std::io::{Read, Write};
    use std::process::Command;

    
pub fn pretty(input: String) -> String {
    use std::fs::File;
    use std::io::{Read, Write};
    use std::process::Command;

    let dir = tempfile::tempdir().expect("Failed to create tempdir");
    let file_path = dir.path().join("source.rs");
    println!("{:?}", file_path);
    let mut file = File::create(&file_path).expect("Failed to create tempfile");

    file.write_all(input.as_bytes())
        .expect("Failed to write source");

    drop(file);

    let mut child = Command::new("rustfmt")
        .arg("--emit")
        .arg("files")
        .arg(file_path.as_os_str())
        .spawn()
        .expect("Rustfmt failed to run");

    let _ = child.wait().expect("Failed to wait for rustfmt");

    let mut result = String::new();

    let mut file = File::open(&file_path).expect("Failed to open tempfile");
    file.sync_all().expect("Faile to sync all");
    file.read_to_string(&mut result)
        .expect("Failed to read from tempfile");

    drop(file);
    dir.close().expect("Failed to close directory");

    result.trim().to_owned()
}