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: tui.rs
    path of file: ./repos/heimdall-rs/crates/core/src/snapshot/util
    
    the code of the file until where you have to start completion: use std::{collections::HashMap, io, time::Duration};

use crossterm::{
    event::{DisableMouseCapture, EnableMouseCapture},
    execute,
    terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
};
use heimdall_common::ether::{
    compiler::Compiler,
    signatures::{ResolvedError, ResolvedLog},
};
use tui::{backend::CrosstermBackend, Terminal};

use crate::{
    error::Error,
    snapsho
    
pub fn cleanup_terminal() -> Result<(), Error> {
    let stdout = io::stdout();
    let backend = CrosstermBackend::new(stdout);
    let mut terminal = Terminal::new(backend)
        .map_err(|_| Error::Generic("failed to create terminal".to_string()))?;
    disable_raw_mode().map_err(|_| Error::Generic("failed to disable raw mode".to_string()))?;
    execute!(terminal.backend_mut(), LeaveAlternateScreen, DisableMouseCapture)
        .map_err(|_| Error::Generic("failed to cleanup terminal".to_string()))?;
    terminal.show_cursor().map_err(|_| Error::Generic("failed to show cursor".to_string()))?;

    Ok(())
}