From 954d755cebab211d39698e9380a9538360d09cfb Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 11 Dec 2025 09:35:16 -0800 Subject: [PATCH] get rid of pub use value::Value; --- rust/pspp/src/data.rs | 2 +- rust/pspp/src/dictionary.rs | 2 +- rust/pspp/src/output.rs | 3 +-- rust/pspp/src/output/pivot.rs | 20 ++++++++-------- rust/pspp/src/output/pivot/output.rs | 4 ++-- rust/pspp/src/output/pivot/tests.rs | 2 +- rust/pspp/src/output/table.rs | 4 ++-- rust/pspp/src/pc.rs | 2 +- rust/pspp/src/por/read.rs | 2 +- rust/pspp/src/spv/read.rs | 2 +- rust/pspp/src/spv/read/html.rs | 2 +- rust/pspp/src/spv/read/legacy_bin.rs | 2 +- rust/pspp/src/spv/read/legacy_xml.rs | 3 +-- rust/pspp/src/spv/read/light.rs | 34 ++++++++++++++-------------- rust/pspp/src/spv/write.rs | 4 ++-- rust/pspp/src/sys/cooked.rs | 2 +- rust/pspp/src/sys/raw.rs | 2 +- rust/pspp/src/sys/tests.rs | 2 +- 18 files changed, 47 insertions(+), 47 deletions(-) diff --git a/rust/pspp/src/data.rs b/rust/pspp/src/data.rs index c2edc22f12..e482841c37 100644 --- a/rust/pspp/src/data.rs +++ b/rust/pspp/src/data.rs @@ -48,7 +48,7 @@ use crate::{ format::DisplayPlain, output::{ Item, Text, - pivot::{Axis3, Dimension, Group, PivotTable, Value}, + pivot::{Axis3, Dimension, Group, PivotTable, value::Value}, }, variable::{VarType, VarWidth}, }; diff --git a/rust/pspp/src/dictionary.rs b/rust/pspp/src/dictionary.rs index 1f30563655..b5d631b98d 100644 --- a/rust/pspp/src/dictionary.rs +++ b/rust/pspp/src/dictionary.rs @@ -38,7 +38,7 @@ use crate::{ data::{ByteString, Datum, RawString}, identifier::{ByIdentifier, HasIdentifier, Identifier}, output::pivot::{ - Axis3, Dimension, Display26Adic, Footnote, Footnotes, Group, PivotTable, Value, + Axis3, Dimension, Display26Adic, Footnote, Footnotes, Group, PivotTable, value::Value, }, settings::Show, variable::{Attributes, VarWidth, Variable}, diff --git a/rust/pspp/src/output.rs b/rust/pspp/src/output.rs index 106616679d..3133d61695 100644 --- a/rust/pspp/src/output.rs +++ b/rust/pspp/src/output.rs @@ -40,11 +40,10 @@ use crate::{ output::pivot::{ Axis3, Dimension, Group, look::{BorderStyle, Look}, + value::Value, }, }; -use self::pivot::Value; - pub mod drivers; pub mod page; pub mod pivot; diff --git a/rust/pspp/src/output/pivot.rs b/rust/pspp/src/output/pivot.rs index f418636b17..66596e6aa6 100644 --- a/rust/pspp/src/output/pivot.rs +++ b/rust/pspp/src/output/pivot.rs @@ -59,10 +59,13 @@ use serde::{Deserialize, Serialize, ser::SerializeMap}; use smallvec::SmallVec; use crate::{ - format::{Format, Settings as FormatSettings, F40, F40_2, F40_3, PCT40_1}, - output::pivot::{look::{Look, Sizing}, value::{ - BareValue, DisplayValue, IntoValueOptions, NumberValue, ValueInner, ValueOptions, - }}, + format::{F40, F40_2, F40_3, Format, PCT40_1, Settings as FormatSettings}, + output::pivot::{ + look::{Look, Sizing}, + value::{ + BareValue, DisplayValue, IntoValueOptions, NumberValue, Value, ValueInner, ValueOptions, + }, + }, settings::{Settings, Show}, variable::Variable, }; @@ -71,9 +74,8 @@ pub(crate) use tlo::parse_bool; mod output; pub use output::OutputTables; mod look_xml; -pub mod value; -pub use value::Value; mod tlo; +pub mod value; #[cfg(test)] pub mod tests; @@ -194,7 +196,7 @@ impl PivotTable { } } -/// Dimensions. +/// A dimension. /// /// A [Dimension] identifies the categories associated with a single dimension /// within a multidimensional pivot table. @@ -1575,10 +1577,10 @@ mod test { use std::str::FromStr; use crate::output::pivot::{ - Display26Adic, MetadataEntry, MetadataValue, Value, + Display26Adic, MetadataEntry, MetadataValue, look::Color, tests::assert_rendering, - value::{TemplateValue, ValueInner}, + value::{TemplateValue, Value, ValueInner}, }; #[test] diff --git a/rust/pspp/src/output/pivot/output.rs b/rust/pspp/src/output/pivot/output.rs index 317da926e3..25bf952301 100644 --- a/rust/pspp/src/output/pivot/output.rs +++ b/rust/pspp/src/output/pivot/output.rs @@ -28,9 +28,9 @@ use crate::output::{ }; use crate::output::pivot::{ - Axis2, Axis3, Dimension, PivotTable, Value, + Axis2, Axis3, Dimension, PivotTable, look::{Area, Border, BorderStyle, BoxBorder, Color, RowColBorder, Stroke}, - value::IntoValueOptions, + value::{IntoValueOptions, Value}, }; /// All of the combinations of dimensions along an axis. diff --git a/rust/pspp/src/output/pivot/tests.rs b/rust/pspp/src/output/pivot/tests.rs index 8149b4fd43..ad73c77a9c 100644 --- a/rust/pspp/src/output/pivot/tests.rs +++ b/rust/pspp/src/output/pivot/tests.rs @@ -36,7 +36,7 @@ use crate::output::{ }, }; -use super::{Axis3, Value}; +use super::{Axis3, value::Value}; #[test] fn color() { diff --git a/rust/pspp/src/output/table.rs b/rust/pspp/src/output/table.rs index eb9b7d04bb..4bf2c26f83 100644 --- a/rust/pspp/src/output/table.rs +++ b/rust/pspp/src/output/table.rs @@ -37,11 +37,11 @@ use ndarray::{Array, Array2}; use crate::{ output::pivot::{ - Axis2, Footnote, Value, + Axis2, Footnote, look::{ Area, AreaStyle, Border, BorderStyle, CellStyle, FontStyle, HeadingRegion, HorzAlign, }, - value::{DisplayValue, ValueInner, ValueOptions}, + value::{DisplayValue, Value, ValueInner, ValueOptions}, }, spv::html, }; diff --git a/rust/pspp/src/pc.rs b/rust/pspp/src/pc.rs index 9627f29aa6..0031452ded 100644 --- a/rust/pspp/src/pc.rs +++ b/rust/pspp/src/pc.rs @@ -45,7 +45,7 @@ use crate::{ dictionary::Dictionary, format::{Error as FormatError, Format, UncheckedFormat}, identifier::{Error as IdError, Identifier}, - output::pivot::{MetadataEntry, MetadataValue, PivotTable, Value}, + output::pivot::{MetadataEntry, MetadataValue, PivotTable, value::Value}, sys::raw::{self, CaseDetails, CaseVar, CompressionAction, records::RawFormat}, variable::{MissingValues, MissingValuesError, VarWidth, Variable}, }; diff --git a/rust/pspp/src/por/read.rs b/rust/pspp/src/por/read.rs index 1bb4c80994..cf79fc8f87 100644 --- a/rust/pspp/src/por/read.rs +++ b/rust/pspp/src/por/read.rs @@ -35,7 +35,7 @@ use crate::{ dictionary::{DictIndex, Dictionary}, format::{Error as FormatError, Format, Type, UncheckedFormat}, identifier::{Error as IdError, Identifier}, - output::pivot::{MetadataEntry, MetadataValue, PivotTable, Value}, + output::pivot::{MetadataEntry, MetadataValue, PivotTable, value::Value}, por::portable_to_windows_1252, variable::{MissingValueRange, MissingValues, MissingValuesError, VarType, VarWidth, Variable}, }; diff --git a/rust/pspp/src/spv/read.rs b/rust/pspp/src/spv/read.rs index fc2b0fff03..05b7063bb9 100644 --- a/rust/pspp/src/spv/read.rs +++ b/rust/pspp/src/spv/read.rs @@ -32,7 +32,7 @@ use crate::{ crypto::EncryptedFile, output::{ Details, Item, SpvInfo, SpvMembers, Text, page, - pivot::{Axis2, Length, TableProperties, Value, look::Look}, + pivot::{Axis2, Length, TableProperties, look::Look, value::Value}, }, spv::read::{ html::Document, diff --git a/rust/pspp/src/spv/read/html.rs b/rust/pspp/src/spv/read/html.rs index 39a01351d0..eefeea481d 100644 --- a/rust/pspp/src/spv/read/html.rs +++ b/rust/pspp/src/spv/read/html.rs @@ -40,8 +40,8 @@ use quick_xml::{ use serde::{Deserialize, Deserializer, Serialize, ser::SerializeMap}; use crate::output::pivot::{ - Value, look::{CellStyle, Color, FontStyle, HorzAlign}, + value::Value, }; fn lowercase<'a>(s: &'a str) -> Cow<'a, str> { diff --git a/rust/pspp/src/spv/read/legacy_bin.rs b/rust/pspp/src/spv/read/legacy_bin.rs index 07fca9ee99..673df36072 100644 --- a/rust/pspp/src/spv/read/legacy_bin.rs +++ b/rust/pspp/src/spv/read/legacy_bin.rs @@ -11,7 +11,7 @@ use crate::{ calendar::{date_time_to_pspp, time_to_pspp}, data::Datum, format::{Category, Format}, - output::pivot::Value, + output::pivot::value::Value, spv::read::light::{U32String, decode_format, parse_vec}, }; diff --git a/rust/pspp/src/spv/read/legacy_xml.rs b/rust/pspp/src/spv/read/legacy_xml.rs index f926961d95..b1e077c1ee 100644 --- a/rust/pspp/src/spv/read/legacy_xml.rs +++ b/rust/pspp/src/spv/read/legacy_xml.rs @@ -36,12 +36,11 @@ use crate::{ format::{self, Decimal::Dot, F8_0, F40_2, Type, UncheckedFormat}, output::pivot::{ self, Axis2, Axis3, Category, CategoryLocator, Dimension, Group, Leaf, Length, PivotTable, - Value, look::{ self, Area, AreaStyle, CellStyle, Color, HeadingRegion, HorzAlign, Look, RowParity, VertAlign, }, - value::{NumberValue, ValueInner}, + value::{NumberValue, Value, ValueInner}, }, spv::read::legacy_bin::DataValue, }; diff --git a/rust/pspp/src/spv/read/light.rs b/rust/pspp/src/spv/read/light.rs index 39cdbe031f..f47987dbdb 100644 --- a/rust/pspp/src/spv/read/light.rs +++ b/rust/pspp/src/spv/read/light.rs @@ -28,7 +28,7 @@ use crate::{ RowColBorder, RowParity, Stroke, VertAlign, }, parse_bool, - value::{StringValue, TemplateValue, ValueStyle, VariableValue}, + value::{self, StringValue, TemplateValue, ValueStyle, VariableValue}, }, settings::Show, }; @@ -1198,15 +1198,15 @@ fn parse_format() -> BinResult { } impl ValueNumber { - fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value { - pivot::Value::new_number_with_format((self.x != -f64::MAX).then_some(self.x), self.format) + fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value { + value::Value::new_number_with_format((self.x != -f64::MAX).then_some(self.x), self.format) .with_styling(ValueMods::decode_optional(&self.mods, encoding, footnotes)) } } impl ValueVarNumber { - fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value { - pivot::Value::new_number_with_format((self.x != -f64::MAX).then_some(self.x), self.format) + fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value { + value::Value::new_number_with_format((self.x != -f64::MAX).then_some(self.x), self.format) .with_styling(ValueMods::decode_optional(&self.mods, encoding, footnotes)) .with_value_label(self.value_label.decode_optional(encoding)) .with_variable_name(Some(self.var_name.decode(encoding))) @@ -1215,8 +1215,8 @@ impl ValueVarNumber { } impl ValueText { - fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value { - pivot::Value::new_general_text( + fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value { + value::Value::new_general_text( self.local.decode(encoding), self.c.decode(encoding), self.id.decode(encoding), @@ -1227,8 +1227,8 @@ impl ValueText { } impl ValueString { - fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value { - pivot::Value::new(pivot::value::ValueInner::String(StringValue { + fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value { + value::Value::new(pivot::value::ValueInner::String(StringValue { s: self.s.decode(encoding), hex: self.format.type_() == Type::AHex, show: self.show, @@ -1240,8 +1240,8 @@ impl ValueString { } impl ValueVarName { - fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value { - pivot::Value::new(pivot::value::ValueInner::Variable(VariableValue { + fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value { + value::Value::new(pivot::value::ValueInner::Variable(VariableValue { show: self.show, var_name: self.var_name.decode(encoding), variable_label: self.var_label.decode_optional(encoding), @@ -1250,8 +1250,8 @@ impl ValueVarName { } } impl ValueFixedText { - fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value { - pivot::Value::new_general_text( + fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value { + value::Value::new_general_text( self.local.decode(encoding), self.c.decode(encoding), self.id.decode(encoding), @@ -1262,8 +1262,8 @@ impl ValueFixedText { } impl ValueTemplate { - fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value { - pivot::Value::new(pivot::value::ValueInner::Template(TemplateValue { + fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value { + value::Value::new(pivot::value::ValueInner::Template(TemplateValue { args: self .args .iter() @@ -1280,7 +1280,7 @@ impl ValueTemplate { } impl Value { - fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> pivot::Value { + fn decode(&self, encoding: &'static Encoding, footnotes: &pivot::Footnotes) -> value::Value { match self { Value::Number(number) => number.decode(encoding, footnotes), Value::VarNumber(var_number) => var_number.decode(encoding, footnotes), @@ -1328,7 +1328,7 @@ impl Argument { &self, encoding: &'static Encoding, footnotes: &pivot::Footnotes, - ) -> Vec { + ) -> Vec { self.0 .iter() .map(|value| value.decode(encoding, footnotes)) diff --git a/rust/pspp/src/spv/write.rs b/rust/pspp/src/spv/write.rs index 1798874d0e..89a36d3362 100644 --- a/rust/pspp/src/spv/write.rs +++ b/rust/pspp/src/spv/write.rs @@ -36,13 +36,13 @@ use crate::{ page::{ChartSize, PageSetup}, pivot::{ Axis2, Axis3, Category, Dimension, Footnote, FootnoteMarkerPosition, - FootnoteMarkerType, Footnotes, Group, Leaf, PivotTable, Value, + FootnoteMarkerType, Footnotes, Group, Leaf, PivotTable, look::{ Area, AreaStyle, Border, BorderStyle, BoxBorder, CellStyle, Color, FontStyle, HeadingRegion, HorzAlign, LabelPosition, RowColBorder, RowParity, Stroke, VertAlign, }, - value::{ValueInner, ValueStyle}, + value::{Value, ValueInner, ValueStyle}, }, }, settings::Show, diff --git a/rust/pspp/src/sys/cooked.rs b/rust/pspp/src/sys/cooked.rs index dfe40a1ce6..fc850837aa 100644 --- a/rust/pspp/src/sys/cooked.rs +++ b/rust/pspp/src/sys/cooked.rs @@ -33,7 +33,7 @@ use crate::{ format::{Error as FormatError, Format, UncheckedFormat}, hexfloat::HexFloat, identifier::{Error as IdError, Identifier}, - output::pivot::{Axis3, Dimension, Group, PivotTable, Value}, + output::pivot::{Axis3, Dimension, Group, PivotTable, value::Value}, sys::{ raw::{ self, CaseDetails, DecodedRecord, RawCases, RawDatum, RawWidth, Reader, infer_encoding, diff --git a/rust/pspp/src/sys/raw.rs b/rust/pspp/src/sys/raw.rs index 00779f054f..4519bf2de5 100644 --- a/rust/pspp/src/sys/raw.rs +++ b/rust/pspp/src/sys/raw.rs @@ -25,7 +25,7 @@ use crate::{ identifier::{Error as IdError, Identifier}, output::{ Details, Item, Text, - pivot::{Axis3, Dimension, Group, PivotTable, Value}, + pivot::{Axis3, Dimension, Group, PivotTable, value::Value}, }, sys::{ encoding::{Error as EncodingError, default_encoding, get_encoding}, diff --git a/rust/pspp/src/sys/tests.rs b/rust/pspp/src/sys/tests.rs index d394c0a9f1..3e2afa3661 100644 --- a/rust/pspp/src/sys/tests.rs +++ b/rust/pspp/src/sys/tests.rs @@ -31,7 +31,7 @@ use crate::{ identifier::Identifier, output::{ Item, Text, - pivot::{Axis3, Dimension, Group, PivotTable, Value, tests::assert_lines_eq}, + pivot::{Axis3, Dimension, Group, PivotTable, tests::assert_lines_eq, value::Value}, }, sys::{ WriteOptions, -- 2.30.2