Skip to content

Commit

Permalink
fix: Revert usage of numeric json types
Browse files Browse the repository at this point in the history
  • Loading branch information
fxwiegand committed Mar 12, 2024
1 parent 6379d21 commit 930a877
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/render/portable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ impl Renderer for ItemRenderer {
None
};

let column_types = classify_table(dataset)?;

for (page, grouped_records) in &dataset
.reader()?
.records()?
Expand All @@ -231,7 +229,6 @@ impl Renderer for ItemRenderer {
self.specs.needs_excel_sheet(),
webview_host,
&view_sizes,
&column_types,
debug,
)?;
}
Expand Down Expand Up @@ -301,7 +298,6 @@ fn render_page<P: AsRef<Path>>(
has_excel_sheet: bool,
webview_host: &str,
view_sizes: &HashMap<String, String>,
column_types: &HashMap<String, ColumnType>,
debug: bool,
) -> Result<()> {
let mut templates = Tera::default();
Expand Down Expand Up @@ -339,22 +335,6 @@ fn render_page<P: AsRef<Path>>(
None
};

let data = data
.iter()
.map(|s| {
s.iter()
.enumerate()
.map(|(i, s)| match column_types.get(&titles[i]) {
Some(ColumnType::Float) => json!(s.parse::<f64>().unwrap()),
Some(ColumnType::Integer) => json!(s.parse::<i64>().unwrap()),
_ => {
json!(s.to_string())
}
})
.collect_vec()
})
.collect_vec();

let compressed_data = compress(json!(data))?;

let local: DateTime<Local> = Local::now();
Expand Down

0 comments on commit 930a877

Please sign in to comment.