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:
@ -185,9 +185,10 @@ impl Model {
|
||||
// so it appears in the grid. _Measure targets are dynamically included
|
||||
// via measure_item_names().
|
||||
if formula.target_category != "_Measure"
|
||||
&& let Some(cat) = self.categories.get_mut(&formula.target_category) {
|
||||
cat.add_item(&formula.target);
|
||||
}
|
||||
&& let Some(cat) = self.categories.get_mut(&formula.target_category)
|
||||
{
|
||||
cat.add_item(&formula.target);
|
||||
}
|
||||
// Replace if same target within the same category
|
||||
if let Some(pos) = self.formulas.iter().position(|f| {
|
||||
f.target == formula.target && f.target_category == formula.target_category
|
||||
@ -331,9 +332,10 @@ impl Model {
|
||||
}
|
||||
for formula in &self.formulas {
|
||||
if let Some(item_val) = key.get(&formula.target_category)
|
||||
&& item_val == formula.target {
|
||||
return self.eval_formula_depth(formula, key, depth - 1);
|
||||
}
|
||||
&& item_val == formula.target
|
||||
{
|
||||
return self.eval_formula_depth(formula, key, depth - 1);
|
||||
}
|
||||
}
|
||||
self.data.get(key).cloned()
|
||||
}
|
||||
@ -456,9 +458,10 @@ impl Model {
|
||||
fn evaluate_formula_cell(&self, key: &CellKey, none_cats: &[String]) -> Option<CellValue> {
|
||||
for formula in &self.formulas {
|
||||
if let Some(item_val) = key.get(&formula.target_category)
|
||||
&& item_val == formula.target {
|
||||
return self.eval_formula_with_cache(formula, key, none_cats);
|
||||
}
|
||||
&& item_val == formula.target
|
||||
{
|
||||
return self.eval_formula_with_cache(formula, key, none_cats);
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
@ -560,9 +563,10 @@ impl Model {
|
||||
use crate::formula::AggFunc;
|
||||
let mut partial = context.without(target_category);
|
||||
if let Expr::Ref(item_name) = inner.as_ref()
|
||||
&& let Some(cat) = find_item_category(model, item_name) {
|
||||
partial = partial.with(cat, item_name.as_str());
|
||||
}
|
||||
&& let Some(cat) = find_item_category(model, item_name)
|
||||
{
|
||||
partial = partial.with(cat, item_name.as_str());
|
||||
}
|
||||
if let Some(f) = agg_filter {
|
||||
partial = partial.with(&f.category, &f.item);
|
||||
}
|
||||
@ -753,9 +757,10 @@ impl Model {
|
||||
Expr::Agg(func, inner, agg_filter) => {
|
||||
let mut partial = context.without(target_category);
|
||||
if let Expr::Ref(item_name) = inner.as_ref()
|
||||
&& let Some(cat) = find_item_category(model, item_name) {
|
||||
partial = partial.with(cat, item_name.as_str());
|
||||
}
|
||||
&& let Some(cat) = find_item_category(model, item_name)
|
||||
{
|
||||
partial = partial.with(cat, item_name.as_str());
|
||||
}
|
||||
if let Some(f) = agg_filter {
|
||||
partial = partial.with(&f.category, &f.item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user