aboutsummaryrefslogtreecommitdiffstats
path: root/src/document/file.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/document/file.rs')
-rw-r--r--src/document/file.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/document/file.rs b/src/document/file.rs
index 6439e27..9efae42 100644
--- a/src/document/file.rs
+++ b/src/document/file.rs
@@ -20,8 +20,8 @@ use std::path::{Path, PathBuf};
use std::sync::{Arc, Mutex, MutexGuard};
use std::time::Duration;
+use super::{ActorId, ChangeHash, Document};
use anyhow::{Context, Result, anyhow, bail};
-use automerge::{ActorId, AutoCommit, ChangeHash};
use serde::{Deserialize, Serialize};
use tokio::time::Instant;
use tracing::{debug, error, warn};
@@ -42,7 +42,7 @@ struct Header {
/// A document file as read at start.
pub(crate) struct Loaded {
/// Under a fresh actor.
- pub(crate) doc: AutoCommit,
+ pub(crate) doc: Document,
/// The actors this node wrote with before.
pub(crate) actors: Vec<ActorId>,
}
@@ -88,7 +88,7 @@ fn parse(bytes: &[u8]) -> Result<(Loaded, usize)> {
.collect::<Result<Vec<_>>>()?;
let mut records = &rest[line_end + 1..];
- let mut doc: Option<AutoCommit> = None;
+ let mut doc: Option<Document> = None;
while !records.is_empty() {
let Some((length, after)) = records.split_first_chunk::<4>() else {
break;
@@ -226,7 +226,7 @@ impl DocumentFile {
pub(crate) async fn rewrite(
self: &Arc<Self>,
epoch: Epoch,
- mut copy: AutoCommit,
+ copy: Document,
own: Vec<ActorId>,
reason: &str,
) {
@@ -247,7 +247,7 @@ impl DocumentFile {
.into_iter()
.filter(|actor| *actor == current || present.contains(actor))
.collect();
- let save = super::save(&mut copy);
+ let save = super::save(&copy);
let bytes = whole(&actors, &save)?;
writer
.files
@@ -327,7 +327,7 @@ mod tests {
#[test]
fn whole_then_increments() {
- let mut doc = AutoCommit::new();
+ let mut doc = Document::new();
change(&mut doc, |doc| doc.put(ROOT, "a", 1_i64).unwrap());
let actor = doc.get_actor().clone();
let heads = doc.get_heads();