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: tests.rs
    path of file: ./repos/mun/crates/mun_hir/src/item_tree
    
    the code of the file until where you have to start completion: use std::fmt;

use crate::{mock::MockDatabase, with_fixture::WithFixture, DefDatabase, DiagnosticSink, Upcast};

fn print_item_tree(text: &str) -> Result<String, fmt::Error> {
    let (db, file_id) = MockDatabase::with_single_file(text);
    let item_tree = db.item_tree(file_id);
    let mut result_str = super::pretty::print_item_tree(db.upcast(), &item_tree)?;
    let mut sink = DiagnosticSink::new(|diag| {
        result
    
fn print_item_tree(text: &str) -> Result<String, fmt::Error> {
    let (db, file_id) = MockDatabase::with_single_file(text);
    let item_tree = db.item_tree(file_id);
    let mut result_str = super::pretty::print_item_tree(db.upcast(), &item_tree)?;
    let mut sink = DiagnosticSink::new(|diag| {
        result_str.push_str(&format!(
            "\n{:?}: {}",
            diag.highlight_range(),
            diag.message()
        ));
    });

    item_tree
        .diagnostics
        .iter()
        .for_each(|diag| diag.add_to(&db, &item_tree, &mut sink));

    drop(sink);
    Ok(result_str)
}