varar_runner/
baseline_store.rs1use std::path::{Path, PathBuf};
6use varar_core::drift::BaselineStore;
7
8pub struct FileBaselineStore {
9 path: PathBuf,
10}
11
12impl FileBaselineStore {
13 pub fn new(root: &Path) -> FileBaselineStore {
14 FileBaselineStore {
15 path: root.join("varar.lock.json"),
16 }
17 }
18}
19
20impl BaselineStore for FileBaselineStore {
21 fn read(&self) -> Option<String> {
22 std::fs::read_to_string(&self.path).ok()
23 }
24
25 fn write(&mut self, contents: &str) {
26 let _ = std::fs::write(&self.path, contents);
27 }
28}