Bugfix/nicolas more fixes (#36)

* FIX: Remove the serde_json depndendency

* UPDATE: Use binary representation also for languages and locales
This commit is contained in:
Nicolás Hatcher Andrés
2024-04-15 19:25:38 +02:00
committed by GitHub
parent 49ef846ebd
commit f9cf86a17c
8 changed files with 23 additions and 61 deletions

View File

@@ -1,12 +1,9 @@
use crate::{
expressions::token::Error, language::Language, number_format::to_excel_precision_str, types::*,
};
use serde::{Deserialize, Serialize};
use serde_json::json;
/// A CellValue is the representation of the cell content.
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[serde(untagged)]
#[derive(Debug, PartialEq)]
pub enum CellValue {
None,
String(String),
@@ -14,17 +11,6 @@ pub enum CellValue {
Boolean(bool),
}
impl CellValue {
pub fn to_json_str(&self) -> String {
match &self {
CellValue::None => "null".to_string(),
CellValue::String(s) => json!(s).to_string(),
CellValue::Number(f) => json!(f).to_string(),
CellValue::Boolean(b) => json!(b).to_string(),
}
}
}
impl From<f64> for CellValue {
fn from(value: f64) -> Self {
Self::Number(value)