Smarter risk and strategy, and logging

This commit is contained in:
2026-07-27 02:38:19 +02:00
parent 9006bc7440
commit 61dc17987d
2 changed files with 52 additions and 0 deletions
+8
View File
@@ -37,6 +37,14 @@ impl Config {
Self::from_str(&output)
}
pub async fn save(&self) -> tokio::io::Result<()> {
let path = crate::store::pulse_config_file()?;
tokio::fs::write(path, self.to_string()?).await?;
Ok(())
}
pub fn from_str(s: &str) -> tokio::io::Result<Self> {
toml::from_str(s)
.map_err(|v| tokio::io::Error::new(std::io::ErrorKind::InvalidInput, v.to_string()))