Add rustfmt configuration and reformat code

- Document new Rust formatting standards in AGENTS, CODE_MAP, and
  PROGRESS.
- Add rustfmt.toml with style 2024, 2‑space indents, 100‑char width, LF
  endings.
- Apply consistent 2‑space indentation and ordering across source files.
- Minor clean‑up of imports and whitespace to match the new style.
This commit is contained in:
GarandPLG committed 2026-10-19 12:21:20 +02:00
1 parent 9e09aaf75e
commit c4313b4117
60 files changed
+3632 -3610

No files matched your search

@@ -1,57 +1,57 @@
use crate::app::states::skirmish_states::Players;
use ratatui::{
style::{Color, Stylize},
text::Line,
style::{Color, Stylize},
text::Line,
};
pub trait Structure {
fn get_tag(&self) -> char;
fn get_tag(&self) -> char;
fn get_color(&self) -> Color;
fn get_color(&self) -> Color;
fn get_level(&self) -> char;
fn get_level(&self) -> char;
fn get_stress(&self) -> u8;
fn get_stress(&self) -> u8;
fn get_durability(&self) -> u16;
fn get_durability(&self) -> u16;
fn get_max_durability(&self) -> u16;
fn get_max_durability(&self) -> u16;
fn get_name(&self) -> &'static str;
fn get_name(&self) -> &'static str;
fn get_owner(&self) -> Players;
fn get_owner(&self) -> Players;
fn base_text(&self) -> Vec<Line<'_>> {
let durability: u16 = self.get_durability();
let max_durability: u16 = self.get_max_durability();
let durability_percent: u32 = durability as u32 * 100 / max_durability as u32;
let stress: u8 = self.get_stress();
let level: char = self.get_level();
fn base_text(&self) -> Vec<Line<'_>> {
let durability: u16 = self.get_durability();
let max_durability: u16 = self.get_max_durability();
let durability_percent: u32 = durability as u32 * 100 / max_durability as u32;
let stress: u8 = self.get_stress();
let level: char = self.get_level();
let mut lines: Vec<Line<'_>> = vec![
Line::from_iter([
"Durability: ".gray(),
durability.to_string().cyan(),
"/".gray(),
max_durability.to_string().cyan(),
" ( ".gray(),
durability_percent.to_string().cyan(),
"% )".gray(),
]),
Line::from_iter(["Stress: ".gray(), stress.to_string().cyan(), "%".gray()]),
];
let mut lines: Vec<Line<'_>> = vec![
Line::from_iter([
"Durability: ".gray(),
durability.to_string().cyan(),
"/".gray(),
max_durability.to_string().cyan(),
" ( ".gray(),
durability_percent.to_string().cyan(),
"% )".gray(),
]),
Line::from_iter(["Stress: ".gray(), stress.to_string().cyan(), "%".gray()]),
];
if level != ' ' {
lines.push(Line::from_iter([
"Level: ".gray(),
level.to_string().cyan(),
]));
}
lines
if level != ' ' {
lines.push(Line::from_iter([
"Level: ".gray(),
level.to_string().cyan(),
]));
}
fn text(&self) -> Vec<Line<'_>> {
self.base_text()
}
lines
}
fn text(&self) -> Vec<Line<'_>> {
self.base_text()
}
}