style: add braces to if statements for consistency

Consolidate if-let chain formatting by adding missing braces throughout the
project. This improves readability and ensures consistency across the
codebase.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
This commit is contained in:
Edward Langley
2026-04-14 00:49:32 -07:00
parent 8baa4c4865
commit 35e2626a7d
8 changed files with 83 additions and 68 deletions

View File

@ -374,12 +374,14 @@ impl App {
}
pub fn autosave_if_needed(&mut self) {
if self.dirty && self.last_autosave.elapsed() > Duration::from_secs(30)
&& let Some(path) = &self.file_path.clone() {
let ap = persistence::autosave_path(path);
let _ = persistence::save(&self.model, &ap);
self.last_autosave = Instant::now();
}
if self.dirty
&& self.last_autosave.elapsed() > Duration::from_secs(30)
&& let Some(path) = &self.file_path.clone()
{
let ap = persistence::autosave_path(path);
let _ = persistence::save(&self.model, &ap);
self.last_autosave = Instant::now();
}
}
pub fn start_import_wizard(&mut self, json: serde_json::Value) {

View File

@ -36,15 +36,14 @@ pub fn build_cat_tree(model: &Model, expanded: &HashSet<String>) -> Vec<CatTreeE
item_count,
expanded: is_expanded,
});
if is_expanded
&& let Some(cat) = cat {
for item_name in cat.ordered_item_names() {
entries.push(CatTreeEntry::Item {
cat_name: cat_name.to_string(),
item_name: item_name.to_string(),
});
}
if is_expanded && let Some(cat) = cat {
for item_name in cat.ordered_item_names() {
entries.push(CatTreeEntry::Item {
cat_name: cat_name.to_string(),
item_name: item_name.to_string(),
});
}
}
}
entries
}

View File

@ -86,9 +86,10 @@ impl Effect for AddFormula {
// appears in the grid. _Measure targets are dynamically included
// via Model::measure_item_names().
if formula.target_category != "_Measure"
&& let Some(cat) = app.model.category_mut(&formula.target_category) {
cat.add_item(&formula.target);
}
&& let Some(cat) = app.model.category_mut(&formula.target_category)
{
cat.add_item(&formula.target);
}
app.model.add_formula(formula);
}
Err(e) => {