From d668ce2ff8f308e54c1c7a2c145cb3479cab899d Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 26 Oct 2026 04:13:11 +0100 Subject: move protocol paths to dedicated module --- src/remake/records.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/remake/records.rs') diff --git a/src/remake/records.rs b/src/remake/records.rs index 82c61a1..119ff0c 100644 --- a/src/remake/records.rs +++ b/src/remake/records.rs @@ -34,7 +34,8 @@ use serde_json::Value as JsonValue; use tracing::warn; use super::kind::DEFAULT_KIND; -use super::snapshot::{META_ROOT, REMAKES, SnapshotRequest, VOTES}; +use super::snapshot::SnapshotRequest; +use crate::document::meta::{self, REMAKES, VOTES}; use crate::document::replica::Epoch; use crate::document::store::{self, StoreError}; @@ -334,7 +335,7 @@ impl Record { // --- document access --------------------------------------------------------- fn records_dir() -> Vec { - vec![META_ROOT.to_owned(), REMAKES.to_owned()] + meta::path(&[REMAKES]) } pub(crate) fn record_path(id: &str, part: &str) -> Vec { @@ -424,12 +425,12 @@ fn contested_decision(doc: &AutoCommit, id: &str) -> Option { } fn register_path(voter: &str) -> Vec { - vec![META_ROOT.to_owned(), VOTES.to_owned(), voter.to_owned()] + meta::path(&[VOTES, voter]) } /// The votes register; unreadable entries are skipped with a warning. pub(crate) fn load_register(doc: &AutoCommit) -> Register { - store::keys_at(doc, &[META_ROOT.to_owned(), VOTES.to_owned()]) + store::keys_at(doc, &meta::path(&[VOTES])) .unwrap_or_default() .into_iter() .filter_map(|voter| { -- cgit v1.3.1