aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/peer/forget.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/swarm/peer/forget.rs')
-rw-r--r--src/swarm/peer/forget.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/swarm/peer/forget.rs b/src/swarm/peer/forget.rs
index a1676b5..8616ae9 100644
--- a/src/swarm/peer/forget.rs
+++ b/src/swarm/peer/forget.rs
@@ -11,7 +11,8 @@ use tracing::{info, warn};
use crate::document::Document;
use crate::document::meta;
-use crate::document::store::{self, StoreError};
+use crate::document::store::StoreError;
+use crate::document::view;
use crate::state::{AppState, Standing};
fn forgotten_dir() -> Vec<String> {
@@ -32,7 +33,7 @@ pub(crate) fn affects_forget_records(path: &[String]) -> bool {
}
fn forgotten_peers(doc: &Document) -> Vec<String> {
- store::keys_at(doc, &forgotten_dir())
+ view::keys_at(doc, &forgotten_dir())
.ok()
.flatten()
.unwrap_or_default()
@@ -56,7 +57,7 @@ pub(super) async fn apply_forget_records(state: &AppState, applied: &mut Applied
forgotten_peers(&replica.doc)
.into_iter()
.filter_map(|pk| {
- let record = store::read_path(&replica.doc, &forgotten_path(&pk)).ok()??;
+ let record = view::read_path(&replica.doc, &forgotten_path(&pk)).ok()??;
Some((pk, record))
})
.collect()
@@ -99,7 +100,7 @@ pub(super) async fn apply_forget_records(state: &AppState, applied: &mut Applied
let local_id = state.local_id().to_owned();
let _ = state
.mutate_doc(move |doc| {
- match store::delete_path(&mut *doc, &forgotten_path(&local_id), false) {
+ match view::delete_path(&mut *doc, &forgotten_path(&local_id), false) {
Ok(()) => {
info!("We were forgotten swarm-wide but are alive; cancelling the record")
}