From 6105507200231e67ba544c12aa10b988e1c23826 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/remake/quarantine.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/remake/quarantine.rs') diff --git a/src/remake/quarantine.rs b/src/remake/quarantine.rs index 5300f54..3ad5005 100644 --- a/src/remake/quarantine.rs +++ b/src/remake/quarantine.rs @@ -5,7 +5,7 @@ //! * `GET /admin/quarantine/{id}` shows the writes: every changed path with the value //! the old document's merged view holds there (`deleted` if none). //! * `GET /admin/quarantine/{id}/document` downloads the old document -//! (`AutoCommit::save()`), for inspection with other tools. +//! (`Document::save()`), for inspection with other tools. //! * `POST /admin/quarantine/{id}/replay` writes them into the current epoch anyway (as //! fresh writes, so they win over what is there) and removes the entry. //! * `DELETE /admin/quarantine/{id}` discards the entry. @@ -14,7 +14,7 @@ use std::convert::Infallible; -use automerge::AutoCommit; +use crate::document::Document; use axum::{ Json, extract::{Path, State}, @@ -69,7 +69,7 @@ pub(super) fn add( host: &H, epoch: Epoch, target: Epoch, - document: &AutoCommit, + document: &Document, quarantined: Vec<(Vec, String)>, ) -> Option { if quarantined.is_empty() { @@ -132,7 +132,7 @@ pub(crate) async fn get(State(host): State, Path(id): Path) } pub(crate) async fn document(State(host): State, Path(id): Path) -> Response { - let Some(mut document) = host + let Some(document) = host .remake() .with_quarantined(&id, |entry| entry.document.clone()) else { -- cgit v1.3.1