docs: fix doctests

This commit is contained in:
zaaarf 2024-10-16 04:00:05 +02:00
parent 7cc8e88402
commit a73a61a841
No known key found for this signature in database
GPG key ID: 102E445F4C3F829B
2 changed files with 5 additions and 5 deletions

View file

@ -31,18 +31,18 @@ pub struct BufferUpdate {
/// ### Examples
/// To insert 'a' after 4th character we should send:
/// ```
/// codemp::api::TextChange { start: 4, end: 4, content: "a".into() };
/// codemp::api::TextChange { start_idx: 4, end_idx: 4, content: "a".into() };
/// ```
///
/// To delete the fourth character we should send:
/// ```
/// codemp::api::TextChange { start: 3, end: 4, content: "".into() };
/// codemp::api::TextChange { start_idx: 3, end_idx: 4, content: "".into() };
/// ```
///
/// ```
/// let change = codemp::api::TextChange {
/// start: 6,
/// end: 11,
/// start_idx: 6,
/// end_idx: 11,
/// content: "mom".to_string()
/// };
/// let before = "hello world!";

View file

@ -72,7 +72,7 @@
//! if let Some(mut update) = buffer.try_recv().await.unwrap() {
//! println!(
//! "content: {}, span: {}-{}",
//! update.change.content, update.change.start, update.change.end
//! update.change.content, update.change.start_idx, update.change.end_idx
//! );
//! buffer.ack(update.version);
//! } // if None, no changes are currently available