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: mod.rs
    path of file: ./repos/some-tank-game-rs/src/exit
    
    the code of the file until where you have to start completion: use bevy::prelude::*;

use crate::{AppState, GameState, Hud};

#[derive(Default)]
pub struct Exit {
    pub paused_the_game:bool
}
pub struct ExitPlugin;


fn input(input:Res<Input<KeyCode>>, mut hud:ResMut<Hud>, mut app_state:ResMut<State<AppState>>, mut game_state:ResMut<State<GameState>>, mut exit:ResMut<Exit>) {
    let escaped = input.just_pressed(KeyCode::Escape);
    let y = input.just_pressed(KeyCode::Y);
    if app_state.current() != &AppState::ShowExit {

    
fn input(input:Res<Input<KeyCode>>, mut hud:ResMut<Hud>, mut app_state:ResMut<State<AppState>>, mut game_state:ResMut<State<GameState>>, mut exit:ResMut<Exit>) {
    let escaped = input.just_pressed(KeyCode::Escape);
    let y = input.just_pressed(KeyCode::Y);
    if app_state.current() != &AppState::ShowExit {
        if escaped {
            hud.push();
            hud.clear();
            hud.center_text = "Press Y to exit the game\nor Escape to return".into();
            if app_state.current() != &AppState::Splash {
                hud.background = Color::rgba(0.0, 0.0, 0.0, 0.75);
            }

            if game_state.current() == &GameState::Running {
                exit.paused_the_game = true;
                game_state.push(GameState::Paused).unwrap();
            } else {
                exit.paused_the_game = false;
            }

            app_state.push(AppState::ShowExit).unwrap();
        }
        
    } else {
        if escaped {
            if exit.paused_the_game == true {
                game_state.pop().unwrap();
            }
            
            hud.pop();
            app_state.pop().unwrap();
        } else if y {
            std::process::exit(0);
        }
    }
}