From f06a6e926980be46e804c8e4494ab81fff32ec93 Mon Sep 17 00:00:00 2001 From: Clover Johnson <95094165+callmeclover@users.noreply.github.com> Date: Thu, 16 May 2024 09:01:13 -0400 Subject: [PATCH] fix issues in multiple files --- src/config.rs | 4 ---- src/func.rs | 6 +++--- src/lists.rs | 14 ++++++++------ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/config.rs b/src/config.rs index 0fa491a..0eb3fce 100644 --- a/src/config.rs +++ b/src/config.rs @@ -68,10 +68,6 @@ impl Default for Basic { } } - - - - pub async fn get_config() -> Config { loop { if Path::new("./config.toml").exists() { diff --git a/src/func.rs b/src/func.rs index a77fea4..57d1f46 100644 --- a/src/func.rs +++ b/src/func.rs @@ -289,9 +289,9 @@ pub async fn main_logic(options: &[(&str, usize)], tts: &mut Tts, enigo: &mut En fn pen(pen: &mut PenInjector, rng: &mut rand::rngs::ThreadRng) { let lists: Vec<(Vec<(&str, usize)>, usize)> = vec![ - (GAMEPAD_BUTTONS.to_vec(), 5), - (GAMEPAD_MOVE.to_vec(), 3), - (GAMEPAD_SPECIAL.to_vec(), 1), + (PEN_BUTTONS.to_vec(), 5), + (PEN_MOVE.to_vec(), 3), + (PEN_SPECIAL.to_vec(), 1), ]; let index: WeightedIndex = WeightedIndex::new(lists.iter().map(|item: &(Vec<(&str, usize)>, usize)| item.1)).unwrap(); diff --git a/src/lists.rs b/src/lists.rs index b2f365a..f63b39c 100644 --- a/src/lists.rs +++ b/src/lists.rs @@ -199,9 +199,8 @@ pub static QUOTES_STATEMENT: [(&str, usize); 9] = [ ("do a flip!", 1) ]; -#[allow(dead_code)] -{ /* Gamepad action lists */ +#[allow(dead_code)] pub static GAMEPAD_BUTTONS: [(&str, usize); 12] = [ ("A", 3), ("B", 3), @@ -217,11 +216,13 @@ pub static GAMEPAD_BUTTONS: [(&str, usize); 12] = [ ("RightTrigger", 2), ]; +#[allow(dead_code)] pub static GAMEPAD_MOVE: [(&str, usize); 2] = [ ("LeftThumbstickMove", 2), ("RightThumbstickMove", 1) ]; +#[allow(dead_code)] pub static GAMEPAD_SPECIAL: [(&str, usize); 4] = [ ("LeftThumbstick", 1), ("Menu", 1), @@ -230,24 +231,25 @@ pub static GAMEPAD_SPECIAL: [(&str, usize); 4] = [ ]; /* Pen action lists */ +#[allow(dead_code)] pub static PEN_BUTTONS: [(&str, usize); 3] = [ ("Barrel", 1), ("Eraser", 1), ("Inverted", 1), ]; +#[allow(dead_code)] pub static PEN_MOVE: [(&str, usize); 2] = [ ("XY_Move", 2), ("X_Move", 1), ("Y_Move", 1) ]; -pub static GAMEPAD_SPECIAL: [(&str, usize); 4] = [ +#[allow(dead_code)] +pub static PEN_SPECIAL: [(&str, usize); 4] = [ ("Pressure", 1), ("Tilt", 1), ("Rotation", 1) ]; -/* Touch action lists */ - -} \ No newline at end of file +/* Touch action lists */ \ No newline at end of file