From fc1f475e50da7e0c1f9dff127c48aad479aa220f Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 24 Oct 2026 02:35:02 +0000 Subject: [PATCH] fix: restore compile and behaviour in Sonar refactors - fonts: char::is_alphanumeric takes &self, so filter needs a closure - h264: keep the mvd accumulator as i32 (prefix is usize) - model: annotate the non-stacked range accumulators as f64 - engine: chart.options still clears the raw chart XML for upDownBars and quartiles; smartart goes back to the glob import (cmd! macro) - web: keep the original viewport meta (behaviour change) Co-Authored-By: Claude Opus 5.5 --- apps/deckcraft-web/index.html | 2 +- crates/engine/src/cmd/insert.rs | 2 ++ crates/engine/src/cmd/smartart.rs | 2 +- crates/fonts/src/fontdb.rs | 2 +- crates/h264/src/cabac_mb.rs | 2 +- crates/model/src/chart.rs | 4 ++-- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/deckcraft-web/index.html b/apps/deckcraft-web/index.html index 852d0202..b1834c33 100644 --- a/apps/deckcraft-web/index.html +++ b/apps/deckcraft-web/index.html @@ -2,7 +2,7 @@ - + DeckCraft diff --git a/crates/engine/src/cmd/insert.rs b/crates/engine/src/cmd/insert.rs index 5bbe995c..4f28ddef 100644 --- a/crates/engine/src/cmd/insert.rs +++ b/crates/engine/src/cmd/insert.rs @@ -1786,9 +1786,11 @@ fn apply_subtotals_and_bars(c: &mut deckcraft_model::chart::Chart, p: &Value, su } if let Some(b) = p.get("upDownBars").and_then(Value::as_bool) { c.up_down_bars = b; + c.raw = None; } if let Some(q) = p.get("quartiles").and_then(Value::as_str) { c.inclusive_quartiles = q.eq_ignore_ascii_case("inclusive"); + c.raw = None; } } diff --git a/crates/engine/src/cmd/smartart.rs b/crates/engine/src/cmd/smartart.rs index 28c601d5..c58d1830 100644 --- a/crates/engine/src/cmd/smartart.rs +++ b/crates/engine/src/cmd/smartart.rs @@ -14,7 +14,7 @@ use deckcraft_model::{ }; use serde_json::{Value, json}; -use super::{CommandSpec, bad, has_selection, str_param, xfrm_of}; +use super::*; use crate::{EngineError, Result, Session}; /// Deepest outline level the Text Pane allows. diff --git a/crates/fonts/src/fontdb.rs b/crates/fonts/src/fontdb.rs index 3f936619..751f36ca 100644 --- a/crates/fonts/src/fontdb.rs +++ b/crates/fonts/src/fontdb.rs @@ -743,7 +743,7 @@ pub fn base_style(style: &str) -> &str { } fn norm(s: &str) -> String { - s.chars().filter(char::is_alphanumeric).flat_map(char::to_lowercase).collect() + s.chars().filter(|c| c.is_alphanumeric()).flat_map(char::to_lowercase).collect() } /// Weight implied by a style name. diff --git a/crates/h264/src/cabac_mb.rs b/crates/h264/src/cabac_mb.rs index 2873c4a7..f1bf6f0d 100644 --- a/crates/h264/src/cabac_mb.rs +++ b/crates/h264/src/cabac_mb.rs @@ -244,7 +244,7 @@ impl SliceDecoder<'_> { while prefix < 9 && c.decode_decision(base + (prefix + 2).min(6)) == 1 { prefix += 1; } - let mut val = prefix; + let mut val = prefix as i32; if prefix >= 9 { // EG3 suffix let mut k = 3; diff --git a/crates/model/src/chart.rs b/crates/model/src/chart.rs index 020cd573..98214f88 100644 --- a/crates/model/src/chart.rs +++ b/crates/model/src/chart.rs @@ -749,8 +749,8 @@ impl Chart { let (mut lo, mut hi) = if self.kind.stacked() { self.stacked_value_range(n) } else { - let mut l = 0.0; - let mut h = 0.0; + let mut l: f64 = 0.0; + let mut h: f64 = 0.0; for s in &self.series { for v in s.values.iter().flatten() { if v.is_finite() {