fix bin to string (read the doc)

This commit is contained in:
2025-04-13 18:57:39 +02:00
parent 2c503c992d
commit 3251523039
2 changed files with 8 additions and 4 deletions

View File

@@ -44,9 +44,13 @@ pub fn save_action(txt: &str, file: &mut File) -> Result<(), std::io::Error> {
file.write_all(string.as_bytes())?;
let map = tree_to_map(&mut tree, true);
eprintln!("&txt = {:?}", &txt);
let trad = body_to_bin(&txt, map);
eprintln!("trad = {:?}", trad);
let trad_bin = string_to_binary(&trad);
eprintln!("trad_bin = {:?}", trad_bin);
let len_body = trad.len() as u32;
eprintln!("len_body = {:?}", len_body);
file.write_all(&len_body.to_be_bytes())?;
file.write_all(&trad_bin)?;
Ok(())