From 9c12bf2e8815dc9b42be62f1e1fd2932dd02938b Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 31 Oct 2026 19:53:27 +0100 Subject: use Automerge as Document instead of AutoCommit This allows a lot of operations to drop mut. --- src/swarm/relay.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/swarm/relay.rs') diff --git a/src/swarm/relay.rs b/src/swarm/relay.rs index d11c3e0..1736cec 100644 --- a/src/swarm/relay.rs +++ b/src/swarm/relay.rs @@ -131,8 +131,8 @@ pub(crate) async fn pull_if_behind( // Those of the listed heads we lack. With a digest only a sample is listed; if we // have all of it, a later keepalive lists others. let missing = { - let mut replica = state.doc.write().await; - crate::document::changes::missing(&mut replica.doc, remote.heads.listed()) + let replica = state.doc.read().await; + crate::document::changes::missing(&replica.doc, remote.heads.listed()) }; if missing.is_empty() { return false; -- cgit v1.3.1