1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-10-02 17:24:28 +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:
jugeeya 2023-12-13 17:52:54 -08:00 committed by GitHub
parent 1475fb2509
commit b2ef9b85a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 14 additions and 16 deletions

View file

@ -9298,7 +9298,7 @@ fn character_pairs() -> [(i32, Character); 97] {
fn get_parent_character(fighter: Character) -> Character {
use Character::*;
return match fighter {
match fighter {
Chrom => Roy,
Daisy => Peach,
Ken => Ryu,
@ -9308,7 +9308,7 @@ fn get_parent_character(fighter: Character) -> Character {
Samusd => Samus,
Wolf => Fox, //Pseudo-echo
_ => fighter,
};
}
}
pub fn kind_to_char(kind: i32) -> Character {

View file

@ -3,6 +3,7 @@
#![feature(const_mut_refs)]
#![feature(exclusive_range_pattern)]
#![feature(c_variadic)]
#![allow(stable_features)]
#![feature(pointer_byte_offsets)]
#![allow(
clippy::borrow_interior_mutable_const,

View file

@ -111,7 +111,7 @@ unsafe fn buff_hero(module_accessor: &mut app::BattleObjectModuleAccessor, statu
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
}
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 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

View file

@ -583,7 +583,7 @@ pub unsafe fn draw(root_pane: &Pane) {
// Left/Right tabs have keys
if let Some(key) = key {
set_icon_text(icon_pane, &vec![**key]);
set_icon_text(icon_pane, &[**key]);
}
if *name == "CurrentTab" {
@ -604,7 +604,7 @@ pub unsafe fn draw(root_pane: &Pane) {
.find_pane_by_name_recursive("set_txt_icon")
.unwrap()
.as_textbox();
set_icon_text(icon_pane, &vec![*key.unwrap()]);
set_icon_text(icon_pane, &[*key.unwrap()]);
key_help_pane
.find_pane_by_name_recursive("set_txt_help")
.unwrap()
@ -627,7 +627,7 @@ pub unsafe fn draw(root_pane: &Pane) {
.find_pane_by_name_recursive("set_txt_icon")
.unwrap()
.as_textbox();
set_icon_text(icon_pane, &vec![*key.unwrap()]);
set_icon_text(icon_pane, &[*key.unwrap()]);
key_help_pane
.find_pane_by_name_recursive("set_txt_help")
.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
let key = clear_toggle_key;
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
.find_pane_by_name_recursive("set_txt_help")
.unwrap()

View file

@ -18,7 +18,7 @@ mod input_log;
pub mod menu;
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("");
let it = pane.text_buf as *mut u16;

View file

@ -1,5 +1,5 @@
use ratatui::widgets::ListState;
use training_mod_tui_2::StatefulList;
use training_mod_tui::StatefulList;
fn initialize_list(selected: Option<usize>) -> StatefulList<u8> {
StatefulList {

View file

@ -1,4 +1,4 @@
use training_mod_tui_2::{SliderState, StatefulSlider};
use training_mod_tui::{SliderState, StatefulSlider};
fn initialize_slider(state: SliderState) -> StatefulSlider {
StatefulSlider {

View file

@ -1,5 +1,5 @@
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> {
let mut s = StatefulTable::with_items(2, 3, vec![0, 1, 2, 3, 4]);

View file

@ -1,5 +1,5 @@
use ratatui::widgets::{TableSelection, TableState};
use training_mod_tui_2::*;
use training_mod_tui::*;
fn make_toggle<'a>(v: u8) -> Toggle<'a> {
Toggle {
@ -55,9 +55,6 @@ fn initialize_submenu<'a>(submenu_type: SubMenuType) -> SubMenu<'a> {
toggles: make_toggle_table_multiple(0, 0, 0),
slider: Some(StatefulSlider::new()),
},
SubMenuType::None => {
panic!()
}
}
}

View file

@ -1,4 +1,4 @@
use training_mod_tui_2::Toggle;
use training_mod_tui::Toggle;
#[test]
fn toggle_serialize() {