work
[pspp] / rust / src / raw.rs
index ab3ad844d9a3cee79b731e00733ebb0a2e0145f3..9fb92f52b07defbb4467e2942d567f1e0a7f53c2 100644 (file)
@@ -326,14 +326,14 @@ impl TryFrom<[u8; 4]> for Magic {
 
 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
 pub enum VarType {
-    Number,
+    Numeric,
     String,
 }
 
 impl VarType {
     fn from_width(width: i32) -> VarType {
         match width {
-            0 => VarType::Number,
+            0 => VarType::Numeric,
             _ => VarType::String,
         }
     }
@@ -506,7 +506,7 @@ impl Value {
     pub fn from_raw(var_type: VarType, raw: [u8; 8], endian: Endian) -> Value {
         match var_type {
             VarType::String => Value::String(UnencodedStr(raw)),
-            VarType::Number => {
+            VarType::Numeric => {
                 let number: f64 = endian.parse(raw);
                 Value::Number((number != -f64::MAX).then_some(number))
             }
@@ -567,7 +567,7 @@ impl Value {
                 match code {
                     0 => (),
                     1..=251 => match var_type {
-                        VarType::Number => break Value::Number(Some(code as f64 - bias)),
+                        VarType::Numeric => break Value::Number(Some(code as f64 - bias)),
                         VarType::String => {
                             break Value::String(UnencodedStr(endian.to_bytes(code as f64 - bias)))
                         }
@@ -586,7 +586,7 @@ impl Value {
                     253 => break Value::from_raw(var_type, read_bytes(reader)?, endian),
                     254 => match var_type {
                         VarType::String => break Value::String(UnencodedStr(*b"        ")), // XXX EBCDIC
-                        VarType::Number => {
+                        VarType::Numeric => {
                             return Err(Error::CompressedStringExpected {
                                 offset: case_start,
                                 case_ofs: reader.stream_position()? - case_start,
@@ -594,7 +594,7 @@ impl Value {
                         }
                     },
                     255 => match var_type {
-                        VarType::Number => break Value::Number(None),
+                        VarType::Numeric => break Value::Number(None),
                         VarType::String => {
                             return Err(Error::CompressedNumberExpected {
                                 offset: case_start,