Smarter risk and strategy, and logging
This commit is contained in:
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user