style: cleanup formatting and code style across the project

Clean up formatting and code style across the project.

- Remove unnecessary whitespace and empty lines in `src/model/cell.rs` ,
  `src/model/types.rs` , and `src/draw.rs` .
- Reformat long lines and function calls in `src/command/cmd.rs` ,
  `src/ui/grid.rs` , and `src/ui/tile_bar.rs` for better readability.
- Consolidate imports and simplify expressions in `src/command/keymap.rs` and
  `src/ui/app.rs` .

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
This commit is contained in:
Edward Langley
2026-04-06 23:18:40 -07:00
parent def4f0b7df
commit 56838c0a61
7 changed files with 205 additions and 102 deletions

View File

@ -157,7 +157,7 @@ impl GridLayout {
.collect()
};
// Sort for deterministic ordering
records.sort_by(|a, b| a.0.0.cmp(&b.0.0));
records.sort_by(|a, b| a.0 .0.cmp(&b.0 .0));
// Synthesize row items: one per record, labeled with its index
let row_items: Vec<AxisEntry> = (0..records.len())
@ -200,7 +200,7 @@ impl GridLayout {
// col_item is a category name
let found = record
.0
.0
.0
.iter()
.find(|(c, _)| c == &col_item)
.map(|(_, v)| v.clone());
@ -610,10 +610,7 @@ mod tests {
m.category_mut("Col").unwrap().add_item("Y");
// Only X has data; Y is entirely empty
m.set_cell(
CellKey::new(vec![
("Row".into(), "A".into()),
("Col".into(), "X".into()),
]),
CellKey::new(vec![("Row".into(), "A".into()), ("Col".into(), "X".into())]),
CellValue::Number(1.0),
);
@ -643,7 +640,9 @@ mod tests {
v.set_axis("_Dim", Axis::Column);
let layout = GridLayout::new(&m, m.active_view());
assert!(layout.is_records_mode());
let cols: Vec<String> = (0..layout.col_count()).map(|i| layout.col_label(i)).collect();
let cols: Vec<String> = (0..layout.col_count())
.map(|i| layout.col_label(i))
.collect();
// All columns return synthetic keys
let value_col = cols.iter().position(|c| c == "Value").unwrap();
let key = layout.cell_key(0, value_col).unwrap();
@ -663,7 +662,9 @@ mod tests {
v.set_axis("_Index", Axis::Row);
v.set_axis("_Dim", Axis::Column);
let layout = GridLayout::new(&m, m.active_view());
let cols: Vec<String> = (0..layout.col_count()).map(|i| layout.col_label(i)).collect();
let cols: Vec<String> = (0..layout.col_count())
.map(|i| layout.col_label(i))
.collect();
// Value column resolves to the cell value
let value_col = cols.iter().position(|c| c == "Value").unwrap();