rustfmt the yb4b/b5dp changes
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdfEGXA7aJ6ftMsCc9PJze
This commit is contained in:
@@ -6066,7 +6066,11 @@ mod column_totals {
|
||||
let rows: Vec<bool> = grid.cells.iter().map(|r| r[col].error).collect();
|
||||
assert_eq!(rows, vec![false, false, true], "East's row must draw div/0");
|
||||
let t = &grid.totals[col];
|
||||
assert_eq!((t.text.as_str(), t.error), ("0.80", false), "48 / 60, pooled");
|
||||
assert_eq!(
|
||||
(t.text.as_str(), t.error),
|
||||
("0.80", false),
|
||||
"48 / 60, pooled"
|
||||
);
|
||||
}
|
||||
|
||||
/// improvise-b5dp: the same ruling for a formula whose own aggregate is zero
|
||||
@@ -6079,6 +6083,10 @@ mod column_totals {
|
||||
let (grid, col) = column(wb, "Share");
|
||||
assert!(grid.cells[2][col].error, "East's row must draw div/0");
|
||||
let t = &grid.totals[col];
|
||||
assert_eq!((t.text.as_str(), t.error), ("1.00", false), "60 / 60, pooled");
|
||||
assert_eq!(
|
||||
(t.text.as_str(), t.error),
|
||||
("1.00", false),
|
||||
"60 / 60, pooled"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,11 +446,9 @@ impl DataStore {
|
||||
};
|
||||
let admits = |ikey: &InternedKey| {
|
||||
(!exact || ikey.0.len() == partial.len() + wanted.len())
|
||||
&& wanted.iter().all(|(cat, items)| {
|
||||
ikey.0
|
||||
.iter()
|
||||
.any(|(c, i)| c == cat && items.contains(i))
|
||||
})
|
||||
&& wanted
|
||||
.iter()
|
||||
.all(|(cat, items)| ikey.0.iter().any(|(c, i)| c == cat && items.contains(i)))
|
||||
};
|
||||
self.matching_positions(partial)
|
||||
.into_iter()
|
||||
@@ -826,7 +824,10 @@ mod data_store {
|
||||
let members: Vec<CellKey> = covered.iter().map(|r| base.clone().with("R", *r)).collect();
|
||||
let sum = |values: Vec<&CellValue>| values.iter().filter_map(|v| v.as_f64()).sum::<f64>();
|
||||
let per_member_exact = members.iter().filter_map(|k| store.get(k)).collect();
|
||||
let per_member_over = members.iter().flat_map(|k| store.matching_values(&k.0)).collect();
|
||||
let per_member_over = members
|
||||
.iter()
|
||||
.flat_map(|k| store.matching_values(&k.0))
|
||||
.collect();
|
||||
let spans = [("R", covered.clone())];
|
||||
let scan_exact = store.spanned_values(&base.0, &spans, true);
|
||||
let scan_over = store.spanned_values(&base.0, &spans, false);
|
||||
|
||||
@@ -824,7 +824,12 @@ impl Model {
|
||||
|
||||
/// A group's stored values fold ONCE over every record the group covers, in
|
||||
/// the store's own order: one scan, not a lookup per member (improvise-yb4b).
|
||||
fn fold_stored(&self, key: &CellKey, expansion: &Expansion, agg: Aggregation) -> Option<CellValue> {
|
||||
fn fold_stored(
|
||||
&self,
|
||||
key: &CellKey,
|
||||
expansion: &Expansion,
|
||||
agg: Aggregation,
|
||||
) -> Option<CellValue> {
|
||||
let exact = agg == Aggregation::Exact;
|
||||
let values = self
|
||||
.data
|
||||
|
||||
Reference in New Issue
Block a user