file-store: persist returns the persisted File object

This commit is contained in:
Louis Dureuil
2025-07-29 13:46:35 +02:00
parent 66d3856014
commit 14507b29d1

View File

@ -148,11 +148,10 @@ impl File {
Ok(Self { path: PathBuf::new(), file: None }) Ok(Self { path: PathBuf::new(), file: None })
} }
pub fn persist(self) -> Result<()> { pub fn persist(self) -> Result<Option<StdFile>> {
if let Some(file) = self.file { let Some(file) = self.file else { return Ok(None) };
file.persist(&self.path)?;
} Ok(Some(file.persist(&self.path)?))
Ok(())
} }
} }