From: Ben Pfaff Date: Fri, 2 Jan 2026 04:22:46 +0000 (-0800) Subject: cleanup X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c62040c23cf7352a86dc6bf1f92074f7d6578c83;p=pspp cleanup --- diff --git a/rust/pspp/src/spv/read/legacy_xml.rs b/rust/pspp/src/spv/read/legacy_xml.rs index 751c606ac3..a8548ed2a6 100644 --- a/rust/pspp/src/spv/read/legacy_xml.rs +++ b/rust/pspp/src/spv/read/legacy_xml.rs @@ -350,14 +350,9 @@ impl Visualization { let Some(graph) = graph else { todo!() }; let mut axes = HashMap::new(); - let mut major_ticks = HashMap::new(); for child in &graph.facet_layout.children { if let FacetLayoutChild::FacetLevel(facet_level) = child { axes.insert(facet_level.level, &facet_level.axis); - major_ticks.insert( - facet_level.axis.major_ticks.id.as_str(), - &facet_level.axis.major_ticks, - ); } } @@ -750,16 +745,10 @@ impl Visualization { } impl TargetType { - fn from_id( - target: &str, - graph: &Graph, - major_ticks: &HashMap<&str, &MajorTicks>, - ) -> Option { - if let Some(id) = &graph.interval.labeling.id - && id == target - { + fn from_id(target: &str) -> Option { + if target == "labeling" { Some(Self::Labeling) - } else if major_ticks.contains_key(target) { + } else if target.ends_with("majorTicks") { Some(Self::MajorTicks) } else { None @@ -881,8 +870,7 @@ impl Visualization { .iter() .filter_map(|set| set.as_set_format()) .filter_map(|sf| { - TargetType::from_id(&sf.target, graph, &major_ticks) - .map(|target_type| Target { sf, target_type }) + TargetType::from_id(&sf.target).map(|target_type| Target { sf, target_type }) }) .collect::>(); @@ -2051,9 +2039,6 @@ impl Interval { #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] struct Labeling { - #[serde(rename = "@id")] - id: Option, - #[serde(rename = "$value", default)] children: Vec, } @@ -2173,9 +2158,6 @@ struct Axis { #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] struct MajorTicks { - #[serde(rename = "@id")] - id: String, - #[serde(rename = "@labelAngle")] label_angle: f64,