FIX: small diverse fixes (#35)

This commit is contained in:
Nicolás Hatcher Andrés
2024-04-14 21:50:14 +02:00
committed by GitHub
parent b3b7dea930
commit 49ef846ebd
25 changed files with 246 additions and 2749 deletions

View File

@@ -129,9 +129,9 @@ pub fn save_xlsx_to_writer<W: Write + Seek>(model: &Model, writer: W) -> Result<
}
/// Exports an internal representation of a workbook into an equivalent IronCalc json format
pub fn save_to_json(workbook: Workbook, output: &str) {
let s = serde_json::to_string(&workbook).unwrap();
pub fn save_to_icalc(workbook: Workbook, output: &str) {
let s = bitcode::encode(&workbook);
let file_path = std::path::Path::new(output);
let mut file = fs::File::create(file_path).unwrap();
file.write_all(s.as_bytes()).unwrap();
file.write_all(&s).unwrap();
}