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: snap_test.rs
    path of file: ./repos/biome/crates/biome_cli/tests
    
    the code of the file until where you have to start completion: use biome_cli::CliDiagnostic;
use biome_console::fmt::{Formatter, Termcolor};
use biome_console::{markup, BufferConsole, Markup};
use biome_diagnostics::termcolor::NoColor;
use biome_diagnostics::{print_diagnostic_to_string, Error};
use b
    
fn replace_temp_dir(input: Cow<str>) -> Cow<str> {
    let mut result = String::new();
    let mut rest = input.as_ref();

    let temp_dir = temp_dir().display().to_string();
    let temp_dir = temp_dir.trim_end_matches(MAIN_SEPARATOR);

    while let Some(index) = rest.find(temp_dir) {
        let (before, after) = rest.split_at(index);

        result.push_str(before);
        result.push_str("<TEMP_DIR>");

        let after = after.split_at(temp_dir.len()).1;
        let header_line = after.lines().next().unwrap();

        match header_line.split_once('\u{2501}') {
            Some((between_temp_and_line, _)) => {
                // Diagnostic header line, normalize the horizontal line
                result.push_str(between_temp_and_line);
                result.push_str(&"\u{2501}".repeat(20));
                rest = after.split_at(header_line.len()).1;
            }
            None => {
                // Not a header line, only replace tempdir
                rest = after;
            }
        }
    }

    if result.is_empty() {
        input
    } else {
        result.push_str(rest);
        Cow::Owned(result)
    }
}