mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2024-11-19 16:36:35 +00:00
Fix Clippy again (#657)
* Fix clippy * More fixes * More fixes * More fixes * More fixes * More fixes * More fixes * More fixes * Fix test * More fixes
This commit is contained in:
parent
1475fb2509
commit
b2ef9b85a7
10 changed files with 14 additions and 16 deletions
|
@ -9298,7 +9298,7 @@ fn character_pairs() -> [(i32, Character); 97] {
|
||||||
|
|
||||||
fn get_parent_character(fighter: Character) -> Character {
|
fn get_parent_character(fighter: Character) -> Character {
|
||||||
use Character::*;
|
use Character::*;
|
||||||
return match fighter {
|
match fighter {
|
||||||
Chrom => Roy,
|
Chrom => Roy,
|
||||||
Daisy => Peach,
|
Daisy => Peach,
|
||||||
Ken => Ryu,
|
Ken => Ryu,
|
||||||
|
@ -9308,7 +9308,7 @@ fn get_parent_character(fighter: Character) -> Character {
|
||||||
Samusd => Samus,
|
Samusd => Samus,
|
||||||
Wolf => Fox, //Pseudo-echo
|
Wolf => Fox, //Pseudo-echo
|
||||||
_ => fighter,
|
_ => fighter,
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn kind_to_char(kind: i32) -> Character {
|
pub fn kind_to_char(kind: i32) -> Character {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#![feature(const_mut_refs)]
|
#![feature(const_mut_refs)]
|
||||||
#![feature(exclusive_range_pattern)]
|
#![feature(exclusive_range_pattern)]
|
||||||
#![feature(c_variadic)]
|
#![feature(c_variadic)]
|
||||||
|
#![allow(stable_features)]
|
||||||
#![feature(pointer_byte_offsets)]
|
#![feature(pointer_byte_offsets)]
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::borrow_interior_mutable_const,
|
clippy::borrow_interior_mutable_const,
|
||||||
|
|
|
@ -111,7 +111,7 @@ unsafe fn buff_hero(module_accessor: &mut app::BattleObjectModuleAccessor, statu
|
||||||
set_buff_rem(module_accessor, buff_vec.len());
|
set_buff_rem(module_accessor, buff_vec.len());
|
||||||
// Since it's the first step of buffing, we need to set up how many buffs there are
|
// Since it's the first step of buffing, we need to set up how many buffs there are
|
||||||
}
|
}
|
||||||
if get_buff_rem(module_accessor) <= 0 {
|
if get_buff_rem(module_accessor) == 0 {
|
||||||
// If there are no buffs selected/left, we're done
|
// If there are no buffs selected/left, we're done
|
||||||
if frame_counter::should_delay(3_u32, *BUFF_DELAY_COUNTER) {
|
if frame_counter::should_delay(3_u32, *BUFF_DELAY_COUNTER) {
|
||||||
// Need to wait 3 frames to make sure we stop the spell SFX, since it's a bit delayed
|
// Need to wait 3 frames to make sure we stop the spell SFX, since it's a bit delayed
|
||||||
|
|
|
@ -583,7 +583,7 @@ pub unsafe fn draw(root_pane: &Pane) {
|
||||||
|
|
||||||
// Left/Right tabs have keys
|
// Left/Right tabs have keys
|
||||||
if let Some(key) = key {
|
if let Some(key) = key {
|
||||||
set_icon_text(icon_pane, &vec![**key]);
|
set_icon_text(icon_pane, &[**key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if *name == "CurrentTab" {
|
if *name == "CurrentTab" {
|
||||||
|
@ -604,7 +604,7 @@ pub unsafe fn draw(root_pane: &Pane) {
|
||||||
.find_pane_by_name_recursive("set_txt_icon")
|
.find_pane_by_name_recursive("set_txt_icon")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_textbox();
|
.as_textbox();
|
||||||
set_icon_text(icon_pane, &vec![*key.unwrap()]);
|
set_icon_text(icon_pane, &[*key.unwrap()]);
|
||||||
key_help_pane
|
key_help_pane
|
||||||
.find_pane_by_name_recursive("set_txt_help")
|
.find_pane_by_name_recursive("set_txt_help")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -627,7 +627,7 @@ pub unsafe fn draw(root_pane: &Pane) {
|
||||||
.find_pane_by_name_recursive("set_txt_icon")
|
.find_pane_by_name_recursive("set_txt_icon")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_textbox();
|
.as_textbox();
|
||||||
set_icon_text(icon_pane, &vec![*key.unwrap()]);
|
set_icon_text(icon_pane, &[*key.unwrap()]);
|
||||||
key_help_pane
|
key_help_pane
|
||||||
.find_pane_by_name_recursive("set_txt_help")
|
.find_pane_by_name_recursive("set_txt_help")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -645,7 +645,7 @@ pub unsafe fn draw(root_pane: &Pane) {
|
||||||
// This is only displayed when you're in a multiple selection toggle menu w/ toggle.max > 1
|
// This is only displayed when you're in a multiple selection toggle menu w/ toggle.max > 1
|
||||||
let key = clear_toggle_key;
|
let key = clear_toggle_key;
|
||||||
let title = "Clear Toggle";
|
let title = "Clear Toggle";
|
||||||
set_icon_text(icon_pane.as_textbox(), &vec![*key.unwrap()]);
|
set_icon_text(icon_pane.as_textbox(), &[*key.unwrap()]);
|
||||||
key_help_pane
|
key_help_pane
|
||||||
.find_pane_by_name_recursive("set_txt_help")
|
.find_pane_by_name_recursive("set_txt_help")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|
|
@ -18,7 +18,7 @@ mod input_log;
|
||||||
pub mod menu;
|
pub mod menu;
|
||||||
pub mod notifications;
|
pub mod notifications;
|
||||||
|
|
||||||
pub unsafe fn set_icon_text(pane: &mut TextBox, icons: &Vec<u16>) {
|
pub unsafe fn set_icon_text(pane: &mut TextBox, icons: &[u16]) {
|
||||||
pane.set_text_string("");
|
pane.set_text_string("");
|
||||||
|
|
||||||
let it = pane.text_buf as *mut u16;
|
let it = pane.text_buf as *mut u16;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use ratatui::widgets::ListState;
|
use ratatui::widgets::ListState;
|
||||||
use training_mod_tui_2::StatefulList;
|
use training_mod_tui::StatefulList;
|
||||||
|
|
||||||
fn initialize_list(selected: Option<usize>) -> StatefulList<u8> {
|
fn initialize_list(selected: Option<usize>) -> StatefulList<u8> {
|
||||||
StatefulList {
|
StatefulList {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use training_mod_tui_2::{SliderState, StatefulSlider};
|
use training_mod_tui::{SliderState, StatefulSlider};
|
||||||
|
|
||||||
fn initialize_slider(state: SliderState) -> StatefulSlider {
|
fn initialize_slider(state: SliderState) -> StatefulSlider {
|
||||||
StatefulSlider {
|
StatefulSlider {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use ratatui::widgets::{TableSelection, TableState};
|
use ratatui::widgets::{TableSelection, TableState};
|
||||||
use training_mod_tui_2::StatefulTable;
|
use training_mod_tui::StatefulTable;
|
||||||
|
|
||||||
fn initialize_table(row: usize, col: usize) -> StatefulTable<u8> {
|
fn initialize_table(row: usize, col: usize) -> StatefulTable<u8> {
|
||||||
let mut s = StatefulTable::with_items(2, 3, vec![0, 1, 2, 3, 4]);
|
let mut s = StatefulTable::with_items(2, 3, vec![0, 1, 2, 3, 4]);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use ratatui::widgets::{TableSelection, TableState};
|
use ratatui::widgets::{TableSelection, TableState};
|
||||||
use training_mod_tui_2::*;
|
use training_mod_tui::*;
|
||||||
|
|
||||||
fn make_toggle<'a>(v: u8) -> Toggle<'a> {
|
fn make_toggle<'a>(v: u8) -> Toggle<'a> {
|
||||||
Toggle {
|
Toggle {
|
||||||
|
@ -55,9 +55,6 @@ fn initialize_submenu<'a>(submenu_type: SubMenuType) -> SubMenu<'a> {
|
||||||
toggles: make_toggle_table_multiple(0, 0, 0),
|
toggles: make_toggle_table_multiple(0, 0, 0),
|
||||||
slider: Some(StatefulSlider::new()),
|
slider: Some(StatefulSlider::new()),
|
||||||
},
|
},
|
||||||
SubMenuType::None => {
|
|
||||||
panic!()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use training_mod_tui_2::Toggle;
|
use training_mod_tui::Toggle;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn toggle_serialize() {
|
fn toggle_serialize() {
|
||||||
|
|
Loading…
Reference in a new issue