Skip to main content

elph_core/layout/
trust.rs

1use anyhow::Result;
2use crate::layout::files::write_json_file;
3use crate::utils::path::AppPaths;
4
5pub struct TrustStore;
6
7impl TrustStore {
8    pub fn ensure<P: AppPaths>(paths: &P) -> Result<()> {
9        let path = paths.trust_path();
10        if path.exists() {
11            return Ok(());
12        }
13
14        write_json_file(&path, &serde_json::json!({}))?;
15        Ok(())
16    }
17}