Skip to content

Commit

Permalink
docs: fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
zaaarf committed Oct 16, 2024
1 parent 7cc8e88 commit a73a61a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/api/change.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!";
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a73a61a

Please sign in to comment.