work
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 9 Jan 2026 18:03:49 +0000 (10:03 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 9 Jan 2026 18:03:49 +0000 (10:03 -0800)
rust/pspp/src/output/pivot/output.rs
rust/pspp/src/output/pivot/value.rs

index 6c5040295b28328add016d4c2bc20bdb79370084..9be29f93c2192f7e8dba5ffc38be17091bb139ff 100644 (file)
@@ -140,8 +140,10 @@ impl PivotTable {
 
     fn create_aux_table<I>(&self, area: Area, axis: Axis2, cells: I) -> Table
     where
-        I: Iterator<Item = Box<Value>> + ExactSizeIterator,
+        I: IntoIterator<Item = Box<Value>>,
+        I::IntoIter: ExactSizeIterator,
     {
+        let cells = cells.into_iter();
         let mut table = Table::new(
             CellPos::for_axis((axis, cells.len()), 1),
             CellPos::new(0, 0),
@@ -149,7 +151,7 @@ impl PivotTable {
             self.borders(false),
             self,
         );
-        for (z, row) in cells.enumerate() {
+        for (z, row) in cells.into_iter().enumerate() {
             table.put(
                 CellRect::for_cell(CellPos::for_axis((axis, z), 0)),
                 CellInner::new(area, row),
@@ -160,8 +162,10 @@ impl PivotTable {
 
     fn create_aux_table_if_nonempty<I>(&self, area: Area, rows: I) -> Option<Table>
     where
-        I: Iterator<Item = Box<Value>> + ExactSizeIterator,
+        I: IntoIterator<Item = Box<Value>>,
+        I::IntoIter: ExactSizeIterator,
     {
+        let rows = rows.into_iter();
         if rows.len() > 0 {
             Some(self.create_aux_table(area, Axis2::Y, rows))
         } else {
@@ -287,7 +291,7 @@ impl PivotTable {
         Some(self.create_aux_table(
             Area::Title,
             Axis2::Y,
-            [self.metadata.title.as_ref()?.clone()].into_iter(),
+            [self.metadata.title.as_ref()?.clone()],
         ))
     }
 
@@ -313,8 +317,7 @@ impl PivotTable {
                     [
                         Box::new(name),
                         dimension.nth_leaf(layer_index).unwrap().name.clone(),
-                    ]
-                    .into_iter(),
+                    ],
                 )
             })
             .collect()
@@ -326,7 +329,7 @@ impl PivotTable {
         Some(self.create_aux_table(
             Area::Caption,
             Axis2::Y,
-            [self.metadata.caption.as_ref()?.clone()].into_iter(),
+            [self.metadata.caption.as_ref()?.clone()],
         ))
     }
 
index 263167b61a3eac6d2266c3206f10fbb796eb77ad..9ee505f1039e17c0867c8319a8dd75a16d0dbedb 100644 (file)
@@ -984,8 +984,6 @@ impl TemplateValue {
         display: &DisplayValue<'a>,
         f: &mut std::fmt::Formatter<'_>,
     ) -> std::fmt::Result {
-        dbg!(self);
-
         #[derive(Copy, Clone, Debug)]
         struct InnerTemplate<'b> {
             template: &'b str,