From 4559c4427fcdebe1b816ce8c4e651cf11571b7d5 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 3 Nov 2026 06:23:23 +0100 Subject: tree changes had already --- src/document/sync.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/document') diff --git a/src/document/sync.rs b/src/document/sync.rs index 44ad833..4a3fe5e 100644 --- a/src/document/sync.rs +++ b/src/document/sync.rs @@ -22,6 +22,13 @@ use crate::transport::SyncPayload; /// A sync message from a peer, decoded (`decode`), to apply (`SyncSession::receive`). pub(crate) struct Received(sync::Message); +impl Received { + /// Whether it carries changes (it may carry only heads and what the peer needs). + pub(crate) fn carries_changes(&self) -> bool { + !self.0.changes.is_empty() + } +} + /// `payload` decoded. Before taking the document's lock: decoding a large message takes /// a while. pub(crate) fn decode(payload: &SyncPayload) -> anyhow::Result { -- cgit v1.3.1