diff --git a/services/cram-console/src/app_autogen.rs b/services/cram-console/src/app_autogen.rs deleted file mode 100644 index c26854719..000000000 --- a/services/cram-console/src/app_autogen.rs +++ /dev/null @@ -1,51 +0,0 @@ -#![cfg_attr(rustfmt, rustfmt_skip)] -// This file is auto-generated by xtask/main.rs generate_app_menus() -use crate::StatusOpcode; -use gam::{MenuItem, MenuPayload}; -use locales::t; -use num_traits::*; -use std::{error::Error, fmt}; - -#[derive(Debug)] -pub enum AppDispatchError { - IndexNotFound(usize), -} - -impl Error for AppDispatchError {} - -impl fmt::Display for AppDispatchError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - AppDispatchError::IndexNotFound(app_index) => write!(f, "Index {} not found", app_index), - } - } -} - -pub(crate) fn app_dispatch(gam: &gam::Gam, token: [u32; 4], index: usize) -> Result<(), AppDispatchError> { - match index { - 0 => { - gam.switch_to_app(gam::APP_NAME_VAULT, token).expect("couldn't raise app"); - Ok(()) - }, - _ => Err(AppDispatchError::IndexNotFound(index)), - } -} - -pub(crate) fn app_index_to_name(index: usize) -> Result<&'static str, AppDispatchError> { - match index { - 0 => Ok(t!("appmenu.vault", locales::LANG)), - _ => Err(AppDispatchError::IndexNotFound(index)), - } -} - -pub(crate) fn app_menu_items(menu_items: &mut Vec::, status_conn: u32) { - - menu_items.push(MenuItem { - name: String::from(t!("appmenu.vault", locales::LANG)), - action_conn: Some(status_conn), - action_opcode: StatusOpcode::SwitchToApp.to_u32().unwrap(), - action_payload: MenuPayload::Scalar([0, 0, 0, 0]), - close_on_select: true, - }); - -}