cleanup
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 2 Jan 2026 18:27:36 +0000 (10:27 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 2 Jan 2026 18:27:36 +0000 (10:27 -0800)
rust/pspp/src/spv/read/legacy_xml.rs

index c5bc81fa8b3ad7f2008b133eebabc6dae1c57a62..5a56934d88cc8b73a22b48ef0e6028dc2dfb082a 100644 (file)
@@ -653,11 +653,12 @@ impl Visualization {
             warn(LegacyXmlWarning::MissingData);
         }
 
-        for child in &graph.facet_layout.children {
-            let FacetLayoutChild::SetCellProperties(scp) = child else {
-                continue;
-            };
-
+        for scp in graph
+            .facet_layout
+            .children
+            .iter()
+            .filter_map(|child| child.set_cell_properties())
+        {
             #[derive(Copy, Clone, Debug, PartialEq)]
             enum TargetType {
                 Labeling,
@@ -1826,6 +1827,12 @@ enum FacetLayoutChild {
 }
 
 impl FacetLayoutChild {
+    fn set_cell_properties(&self) -> Option<&SetCellProperties> {
+        match self {
+            Self::SetCellProperties(scp) => Some(scp),
+            _ => None,
+        }
+    }
     fn facet_level(&self) -> Option<&FacetLevel> {
         match self {
             Self::FacetLevel(facet_level) => Some(facet_level),