From 56b9db7221dc8a919a4908f5b964412088198701 Mon Sep 17 00:00:00 2001 From: Jan Ferdinand Sauer Date: Thu, 21 Dec 2023 09:49:20 +0100 Subject: [PATCH] remove argument `--frame-rate` --- triton-tui/src/args.rs | 11 ----------- triton-tui/src/tui.rs | 7 ++++--- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/triton-tui/src/args.rs b/triton-tui/src/args.rs index ac860562b..3a2da5d77 100644 --- a/triton-tui/src/args.rs +++ b/triton-tui/src/args.rs @@ -3,7 +3,6 @@ use clap::Parser; use crate::utils::version; const DEFAULT_PROGRAM_PATH: &str = "./program.tasm"; -const DEFAULT_FRAME_RATE: f64 = 32.0; #[derive(Debug, Clone, PartialEq, Parser)] #[command(author, version = version(), about)] @@ -24,15 +23,6 @@ pub(crate) struct Args { #[arg(short, long, value_name = "PATH")] /// Path to JSON file containing all non-determinism pub non_determinism: Option, - - #[arg( - short, - long, - value_name = "FLOAT", - default_value_t = DEFAULT_FRAME_RATE - )] - /// Frame rate, i.e. number of frames per second - pub frame_rate: f64, } impl Default for Args { @@ -41,7 +31,6 @@ impl Default for Args { program: DEFAULT_PROGRAM_PATH.into(), input: None, non_determinism: None, - frame_rate: DEFAULT_FRAME_RATE, } } } diff --git a/triton-tui/src/tui.rs b/triton-tui/src/tui.rs index 7bafded9d..128892e69 100644 --- a/triton-tui/src/tui.rs +++ b/triton-tui/src/tui.rs @@ -29,6 +29,7 @@ pub(crate) fn io() -> IO { } const DEFAULT_TICK_RATE: f64 = 1.0; +const DEFAULT_FRAME_RATE: f64 = 32.0; #[derive(Clone, Debug, Serialize, Deserialize)] pub(crate) enum Event { @@ -67,7 +68,7 @@ impl Tui { } let tick_rate = DEFAULT_TICK_RATE; - let frame_rate = Args::default().frame_rate; + let frame_rate = DEFAULT_FRAME_RATE; let terminal = Terminal::new(Backend::new(io()))?; let (event_tx, event_rx) = unbounded_channel(); let cancellation_token = CancellationToken::new(); @@ -85,8 +86,8 @@ impl Tui { }) } - pub fn apply_args(&mut self, args: &Args) -> &mut Self { - self.frame_rate(args.frame_rate); + pub fn apply_args(&mut self, _: &Args) -> &mut Self { + self.frame_rate(DEFAULT_FRAME_RATE); self.mouse(true); self.paste(true); self