From 3382ea72eaf93270ac7d9a881f27419c18cf98a7 Mon Sep 17 00:00:00 2001 From: alemi Date: Sun, 20 Aug 2023 01:28:15 +0200 Subject: [PATCH] docs: fix example --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1c6bfa1..bc2a572 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -62,13 +62,13 @@ //! let buffer = codemp.attach("test.txt").await?; //! //! // sending operation -//! if let Some(delta) = buffer.delta(0, "hello", 0) { -//! buffer.send(delta).expect("could not enqueue operation"); -//! } +//! buffer.send(buffer.insert("hello", 0))?; //! -//! if let Some(delta) = buffer.delta(4, "o world", 5) { -//! buffer.send(delta).expect("could not enqueue operation"); +//! if let Some(operation) = buffer.delta(4, "o world", 5) { +//! buffer.send(operation)?; //! } +//! +//! assert_eq!(buffer.content(), "hello world"); //! //! Ok(()) //! }