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: inputs.rs
    path of file: ./repos/feroxbuster/src/event_handlers
    
    the code of the file until where you have to start completion: use super::*;
use crate::{
    progress::PROGRESS_PRINTER,
    scan_manager::{FeroxState, PAUSE_SCAN},
    scanner::RESPONSES,
    statistics::StatError,
    utils::slugify_filename,
    utils::{open_file, write_to},
    SLEEP_DURATION,
};
use anyhow::Result;
use console::style;
use crossterm::event::{self, Event, KeyCo
    
    pub fn sigint_handler(handles: Arc<Handles>) -> Result<()> {
        log::trace!("enter: sigint_handler({:?})", handles);

        let filename = if !handles.config.target_url.is_empty() {
            // target url populated
            slugify_filename(&handles.config.target_url, "ferox", "state")
        } else {
            // stdin used
            slugify_filename("stdin", "ferox", "state")
        };

        let warning = format!(
            "üö® Caught {} üö® saving scan state to {} ...",
            style("ctrl+c").yellow(),
            filename
        );

        PROGRESS_PRINTER.println(warning);

        let state = FeroxState::new(
            handles.ferox_scans()?,
            handles.config.clone(),
            &RESPONSES,
            handles.stats.data.clone(),
            handles.filters.data.clone(),
        );

        // User didn't set the --no-state flag (so saved_state is still the default true)
        if handles.config.save_state {
            let Ok(mut state_file) = open_file(&filename) else {
                // couldn't open the file, let the user know we're going to try again
                let error = format!(
                    "‚ùå Could not save {}, falling back to {}",
                    filename,
                    temp_dir().to_string_lossy()
                );
                PROGRESS_PRINTER.println(error);

                let temp_filename = temp_dir().join(&filename);

                let Ok(mut state_file) = open_file(&temp_filename.to_string_lossy()) else {
                    // couldn't open the fallback file, let the user know
                    let error = format!("‚ùå‚ùå Could not save {:?}, giving up...", temp_filename);
                    PROGRESS_PRINTER.println(error);

                    log::trace!("exit: sigint_handler (failed to write)");
                    std::process::exit(1);
                };

                write_to(&state, &mut state_file, true)?;

                let msg = format!("‚úÖ Saved scan state to {:?}", temp_filename);
                PROGRESS_PRINTER.println(msg);

                log::trace!("exit: sigint_handler (saved to temp folder)");
                std::process::exit(1);
            };

            write_to(&state, &mut state_file, true)?;
        }

        log::trace!("exit: sigint_handler (end of program)");
        std::process::exit(1);
    }