aboutsummaryrefslogtreecommitdiffstats
path: root/src/api
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 19:53:27 +0100
committertv <tv@krebsco.de>2026-10-31 19:53:27 +0100
commit9c12bf2e8815dc9b42be62f1e1fd2932dd02938b (patch)
tree09cd985fae9142a247a2285c755f9d002a2c7b30 /src/api
parentf4b0a7c5159d418e22682d2bd7d413fb3587ca7f (diff)
use Automerge as Document instead of AutoCommit
This allows a lot of operations to drop mut.
Diffstat (limited to 'src/api')
-rw-r--r--src/api/document.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/document.rs b/src/api/document.rs
index 08fd21f..bc8c47e 100644
--- a/src/api/document.rs
+++ b/src/api/document.rs
@@ -50,11 +50,11 @@ pub(crate) async fn get_document(State(state): State<AppState>) -> Response {
// Both steps take time proportional to the document: off the async threads, and
// the lock only for the copy.
let saved = tokio::task::spawn_blocking(move || {
- let (mut copy, epoch, heads) = {
+ let (copy, epoch, heads) = {
let replica = doc.blocking_read();
(replica.doc.clone(), replica.epoch, replica.heads().to_vec())
};
- (crate::document::save(&mut copy), heads, epoch)
+ (crate::document::save(&copy), heads, epoch)
})
.await;
let (bytes, heads, epoch) = match saved {