From ddd065dd3a5c8acb12095fd819619e0c95ce7e26 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sat, 12 Jul 2025 11:21:57 +0100 Subject: [PATCH] Improve docs --- src/operation_transformation/edited_text.rs | 4 ++++ src/utils/is_binary.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/operation_transformation/edited_text.rs b/src/operation_transformation/edited_text.rs index eb8488c..4a79fb8 100644 --- a/src/operation_transformation/edited_text.rs +++ b/src/operation_transformation/edited_text.rs @@ -91,6 +91,10 @@ where } } + /// Merge two `EditedText` instances. The two instances must be derived + /// from the same original text. The operations are merged using the + /// principles of Operational Transformation. The cursors are updated + /// accordingly to reflect the changes made by the merged operations. #[must_use] #[allow(clippy::too_many_lines)] pub fn merge(self, other: Self) -> Self { diff --git a/src/utils/is_binary.rs b/src/utils/is_binary.rs index 46488e3..09bfcf9 100644 --- a/src/utils/is_binary.rs +++ b/src/utils/is_binary.rs @@ -1,5 +1,7 @@ /// Heuristically determine if the given data is a binary or a text file's /// content. +/// +/// Only text inputs can be reconciled using the crate's functions. #[must_use] pub fn is_binary(data: &[u8]) -> bool { if data.contains(&0) {