From: Ben Pfaff Date: Sat, 3 Jan 2026 19:37:53 +0000 (-0800) Subject: cleanup X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d0ae3962789c8b77eb5e0f4f7b7604ab9b63480;p=pspp cleanup --- diff --git a/rust/pspp/src/spv/read/legacy_xml.rs b/rust/pspp/src/spv/read/legacy_xml.rs index e4c575a090..ea27c1e00c 100644 --- a/rust/pspp/src/spv/read/legacy_xml.rs +++ b/rust/pspp/src/spv/read/legacy_xml.rs @@ -60,16 +60,8 @@ impl DataValue { /// Category index, if any. This is the numeric value of the datum, if /// there is one, falling back to the index. pub fn category(&self) -> Option { - match &self.value { - Datum::Number(number) => *number, - _ if self.index.is_some() => self.index, - Datum::String(string) => { - // This only comes up in a few cases which indicate something - // odd might have happened to the table in the SPV files. - string.parse().ok() - } - } - .and_then(|v| (v >= 0.0 && v < usize::MAX as f64).then_some(v as usize)) + self.index + .and_then(|v| (v >= 0.0 && v < usize::MAX as f64).then_some(v as usize)) } /// Interprets this data value as a [Format], first by looking it up in