diff options
| author | tv <tv@krebsco.de> | 2026-10-31 19:53:27 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-31 19:53:27 +0100 |
| commit | 6105507200231e67ba544c12aa10b988e1c23826 (patch) | |
| tree | 880530b7401cb5d43f52e06a68b4d704326aa272 /src/document/store.rs | |
| parent | 8d7adfbdb7798cca9d9783761f290e3bd85d9a3a (diff) | |
use Automerge as Document instead of AutoCommit
This allows a lot of operations to drop mut.
Diffstat (limited to 'src/document/store.rs')
| -rw-r--r-- | src/document/store.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/document/store.rs b/src/document/store.rs index 7d54626..0a3c8ad 100644 --- a/src/document/store.rs +++ b/src/document/store.rs @@ -2,7 +2,7 @@ use anyhow::anyhow; use automerge::{ - ActorId, AutoCommit, ObjId, ObjType, Prop, ReadDoc, ScalarValue, Value, + ActorId, Automerge, ObjId, ObjType, Prop, ReadDoc, ScalarValue, Value, transaction::Transactable, }; use base64::{Engine, engine::general_purpose::STANDARD as BASE64}; @@ -37,7 +37,7 @@ pub(crate) struct Changed { /// incremented in a map by its key, and list and text edits by the containing object; /// inside a list as `lists` says. pub(crate) fn changed( - doc: &mut AutoCommit, + doc: &Automerge, before: &[automerge::ChangeHash], after: &[automerge::ChangeHash], lists: InLists, @@ -1088,7 +1088,7 @@ mod tests { #[test] fn paths_go_through_lists() { - let mut doc = AutoCommit::new(); + let mut doc = Automerge::new(); try_change(&mut doc, |doc| { write_path(doc, &path("list"), &json!(["b", {"k": 1}, "d"])) }) @@ -1133,7 +1133,7 @@ mod tests { #[test] fn negative_indexes_count_from_the_end() { - let mut doc = AutoCommit::new(); + let mut doc = Automerge::new(); try_change(&mut doc, |doc| { write_path(doc, &path("list"), &json!(["a", "b"])) }) @@ -1161,7 +1161,7 @@ mod tests { #[test] fn inserts_into_lists() { - let mut doc = AutoCommit::new(); + let mut doc = Automerge::new(); try_change(&mut doc, |doc| { write_path(doc, &path("list"), &json!(["b", "d"])) }) |
