impl File.stage_persisted

master
Bel LaPointe 2025-11-11 11:03:05 -07:00
parent 9242d41a0f
commit 1dc9b6149c
1 changed files with 5 additions and 1 deletions

View File

@ -119,7 +119,11 @@ impl File {
} }
fn stage_persisted(&self) -> Result<(), String> { fn stage_persisted(&self) -> Result<(), String> {
Err("not impl".to_string()) let stage = self.events()?.snapshot()?;
let plaintext = serde_yaml::to_string(&stage).unwrap();
let mut f = std::fs::File::create(&self.file).expect("failed to open file for writing");
writeln!(f, "{}", plaintext).expect("failed to write");
Ok(())
} }
fn persist_stage(&self) -> Result<(), String> { fn persist_stage(&self) -> Result<(), String> {