mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
clippy fixes
This commit is contained in:
parent
d5f79b3872
commit
d354efc239
@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
use std::time::Duration;
|
|
||||||
use crate::comp;
|
use crate::comp;
|
||||||
|
use std::time::Duration;
|
||||||
|
|
||||||
pub struct DebugInfo {
|
pub struct DebugInfo {
|
||||||
pub tps: f64,
|
pub tps: f64,
|
||||||
@ -17,4 +16,4 @@ pub struct DebugInfo {
|
|||||||
pub num_figures_visible: u32,
|
pub num_figures_visible: u32,
|
||||||
pub num_particles: u32,
|
pub num_particles: u32,
|
||||||
pub num_particles_visible: u32,
|
pub num_particles_visible: u32,
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ pub fn draw_char_state_group(
|
|||||||
) {
|
) {
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
ui.label("Current State: ");
|
ui.label("Current State: ");
|
||||||
ui.label(format!("{}", character_state.to_string()));
|
ui.label(character_state.to_string());
|
||||||
});
|
});
|
||||||
match character_state {
|
match character_state {
|
||||||
CharacterState::ComboMelee(data) => {
|
CharacterState::ComboMelee(data) => {
|
||||||
@ -31,10 +31,10 @@ fn charged_melee_grid(ui: &mut Ui, data: &charged_melee::Data) {
|
|||||||
.max_col_width(100.0)
|
.max_col_width(100.0)
|
||||||
.striped(true)
|
.striped(true)
|
||||||
.show(ui, |ui| #[rustfmt::skip] {
|
.show(ui, |ui| #[rustfmt::skip] {
|
||||||
two_col_row(ui, "Stage Section", format!("{}", data.stage_section));
|
two_col_row(ui, "Stage Section", data.stage_section.to_string());
|
||||||
two_col_row(ui, "Timer", format!("{}ms", data.timer.as_millis()));
|
two_col_row(ui, "Timer", format!("{}ms", data.timer.as_millis()));
|
||||||
two_col_row(ui, "Charge Amount", format!("{:.1}", data.charge_amount));
|
two_col_row(ui, "Charge Amount", format!("{:.1}", data.charge_amount));
|
||||||
two_col_row(ui, "Exhausted", format!("{}", if data.exhausted { "True" } else { "False " }));
|
two_col_row(ui, "Exhausted", (if data.exhausted { "True" } else { "False" }).to_string());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,9 +44,9 @@ fn combo_melee_grid(ui: &mut Ui, data: &combo_melee::Data) {
|
|||||||
.max_col_width(100.0)
|
.max_col_width(100.0)
|
||||||
.striped(true)
|
.striped(true)
|
||||||
.show(ui, |ui| #[rustfmt::skip] {
|
.show(ui, |ui| #[rustfmt::skip] {
|
||||||
two_col_row(ui, "Stage", format!("{}", data.stage));
|
two_col_row(ui, "Stage", data.stage.to_string());
|
||||||
two_col_row(ui, "Timer", format!("{}ms", data.timer.as_millis()));
|
two_col_row(ui, "Timer", format!("{}ms", data.timer.as_millis()));
|
||||||
two_col_row(ui, "num_stages", format!("{}", data.static_data.num_stages));
|
two_col_row(ui, "num_stages", data.static_data.num_stages.to_string());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,10 +56,10 @@ fn dash_melee_grid(ui: &mut Ui, data: &dash_melee::Data) {
|
|||||||
.max_col_width(100.0)
|
.max_col_width(100.0)
|
||||||
.striped(true)
|
.striped(true)
|
||||||
.show(ui, |ui| #[rustfmt::skip] {
|
.show(ui, |ui| #[rustfmt::skip] {
|
||||||
two_col_row(ui, "Auto Charge", format!("{}", if data.auto_charge { "True" } else { "False " }));
|
two_col_row(ui, "Auto Charge", (if data.auto_charge { "True" } else { "False " }).to_string());
|
||||||
two_col_row(ui, "Timer", format!("{}ms", data.timer.as_millis()));
|
two_col_row(ui, "Timer", format!("{}ms", data.timer.as_millis()));
|
||||||
two_col_row(ui, "Stage Section", data.stage_section.to_string());
|
two_col_row(ui, "Stage Section", data.stage_section.to_string());
|
||||||
two_col_row(ui, "Exhausted", format!("{}", if data.exhausted { "True" } else { "False " }));
|
two_col_row(ui, "Exhausted", (if data.exhausted { "True" } else { "False " }).to_string());
|
||||||
two_col_row(ui, "Charge End Timer", format!("{}ms", data.charge_end_timer.as_millis()));
|
two_col_row(ui, "Charge End Timer", format!("{}ms", data.charge_end_timer.as_millis()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -70,8 +70,8 @@ fn leap_melee_grid(ui: &mut Ui, data: &leap_melee::Data) {
|
|||||||
.max_col_width(100.0)
|
.max_col_width(100.0)
|
||||||
.striped(true)
|
.striped(true)
|
||||||
.show(ui, |ui| #[rustfmt::skip] {
|
.show(ui, |ui| #[rustfmt::skip] {
|
||||||
two_col_row(ui, "Stage Section", format!("{}", data.stage_section));
|
two_col_row(ui, "Stage Section", data.stage_section.to_string());
|
||||||
two_col_row(ui, "Timer", format!("{}ms", data.timer.as_millis()));
|
two_col_row(ui, "Timer", format!("{}ms", data.timer.as_millis()));
|
||||||
two_col_row(ui, "Exhausted", format!("{}", if data.exhausted { "True" } else { "False " }));
|
two_col_row(ui, "Exhausted", (if data.exhausted { "True" } else { "False " }).to_string());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -507,7 +507,7 @@ fn selected_entity_window(
|
|||||||
.spacing([40.0, 4.0])
|
.spacing([40.0, 4.0])
|
||||||
.striped(true)
|
.striped(true)
|
||||||
.show(ui, |ui| {
|
.show(ui, |ui| {
|
||||||
two_col_row(ui, "Name", format!("{}", stats.name));
|
two_col_row(ui, "Name", stats.name.to_string());
|
||||||
two_col_row(ui, "Damage Reduction", format!("{:.1}", stats.damage_reduction));
|
two_col_row(ui, "Damage Reduction", format!("{:.1}", stats.damage_reduction));
|
||||||
two_col_row(ui, "Max Health Modifier", format!("{:.1}", stats.max_health_modifier));
|
two_col_row(ui, "Max Health Modifier", format!("{:.1}", stats.max_health_modifier));
|
||||||
two_col_row(ui, "Move Speed Modifier", format!("{:.1}", stats.move_speed_modifier));
|
two_col_row(ui, "Move Speed Modifier", format!("{:.1}", stats.move_speed_modifier));
|
||||||
@ -521,8 +521,8 @@ fn selected_entity_window(
|
|||||||
.spacing([40.0, 4.0])
|
.spacing([40.0, 4.0])
|
||||||
.striped(true)
|
.striped(true)
|
||||||
.show(ui, |ui| {
|
.show(ui, |ui| {
|
||||||
two_col_row(ui, "Type", format!("{}", body.to_string()));
|
two_col_row(ui, "Type", body.to_string());
|
||||||
two_col_row(ui, "Species", format!("{}", body_species(body)));
|
two_col_row(ui, "Species", body_species(body));
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -552,7 +552,7 @@ fn selected_entity_window(
|
|||||||
poise_state_label(ui, poise);
|
poise_state_label(ui, poise);
|
||||||
ui.end_row();
|
ui.end_row();
|
||||||
two_col_row(ui, "Current", format!("{}/{}", poise.current(), poise.maximum()));
|
two_col_row(ui, "Current", format!("{}/{}", poise.current(), poise.maximum()));
|
||||||
two_col_row(ui, "Base Max", format!("{}", poise.base_max()));
|
two_col_row(ui, "Base Max", poise.base_max().to_string());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -632,10 +632,10 @@ fn selected_entity_window(
|
|||||||
.spacing([40.0, 4.0])
|
.spacing([40.0, 4.0])
|
||||||
.striped(true)
|
.striped(true)
|
||||||
.show(ui, |ui| {
|
.show(ui, |ui| {
|
||||||
two_col_row(ui, "On Ground", format!("{}", if physics_state.on_ground { "True" } else { "False " }));
|
two_col_row(ui, "On Ground", (if physics_state.on_ground { "True" } else { "False " }).to_string());
|
||||||
two_col_row(ui, "On Ceiling", format!("{}", if physics_state.on_ceiling { "True" } else { "False " }));
|
two_col_row(ui, "On Ceiling", (if physics_state.on_ceiling { "True" } else { "False " }).to_string());
|
||||||
two_col_row(ui, "On Wall", physics_state.on_wall.map_or("-".to_owned(), |x| format!("{:.1},{:.1},{:.1}", x.x, x.y, x.z )));
|
two_col_row(ui, "On Wall", physics_state.on_wall.map_or("-".to_owned(), |x| format!("{:.1},{:.1},{:.1}", x.x, x.y, x.z )));
|
||||||
two_col_row(ui, "Touching Entities", format!("{}", physics_state.touch_entities.len()));
|
two_col_row(ui, "Touching Entities", physics_state.touch_entities.len().to_string());
|
||||||
two_col_row(ui, "In Fluid", match physics_state.in_fluid {
|
two_col_row(ui, "In Fluid", match physics_state.in_fluid {
|
||||||
|
|
||||||
Some(Fluid::Air { elevation, .. }) => format!("Air (Elevation: {:.1})", elevation),
|
Some(Fluid::Air { elevation, .. }) => format!("Air (Elevation: {:.1})", elevation),
|
||||||
|
@ -80,6 +80,7 @@ use common::{
|
|||||||
BuffData, BuffKind, Item,
|
BuffData, BuffKind, Item,
|
||||||
},
|
},
|
||||||
consts::MAX_PICKUP_RANGE,
|
consts::MAX_PICKUP_RANGE,
|
||||||
|
debug_info::DebugInfo,
|
||||||
outcome::Outcome,
|
outcome::Outcome,
|
||||||
slowjob::SlowJobPool,
|
slowjob::SlowJobPool,
|
||||||
terrain::{SpriteKind, TerrainChunk},
|
terrain::{SpriteKind, TerrainChunk},
|
||||||
@ -108,7 +109,6 @@ use std::{
|
|||||||
time::{Duration, Instant},
|
time::{Duration, Instant},
|
||||||
};
|
};
|
||||||
use vek::*;
|
use vek::*;
|
||||||
use common::debug_info::DebugInfo;
|
|
||||||
|
|
||||||
const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0);
|
const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0);
|
||||||
const TEXT_VELORITE: Color = Color::Rgba(0.0, 0.66, 0.66, 1.0);
|
const TEXT_VELORITE: Color = Color::Rgba(0.0, 0.66, 0.66, 1.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user