From 1dc9b6149c203dabce247dbe0f0e778dc8b4d5cc Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Tue, 11 Nov 2025 11:03:05 -0700 Subject: [PATCH] impl File.stage_persisted --- pttodoest/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pttodoest/src/main.rs b/pttodoest/src/main.rs index f24388f..bf88f27 100755 --- a/pttodoest/src/main.rs +++ b/pttodoest/src/main.rs @@ -119,7 +119,11 @@ impl File { } 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> {