Change style

This commit is contained in:
Andras Schmelczer 2026-03-10 20:42:09 +00:00
parent 408ce5268f
commit deffa195b3
23 changed files with 72 additions and 76 deletions

View file

@ -1,6 +1,6 @@
use super::token::Token;
/// Splits text into UTF-8 characters.
/// Splits text into UTF-8 characters
///
/// ```not_rust
/// "Hey!" -> ["H", "e", "y", "!"]

View file

@ -1,6 +1,6 @@
use super::token::Token;
/// Splits text into lines, preserving line endings as separate tokens.
/// Splits text into lines, preserving line endings as separate tokens
///
/// ## Example
///

View file

@ -14,21 +14,21 @@ pub struct Token<T>
where
T: PartialEq + Clone + Debug,
{
/// The normalized form of the token used deriving the diff.
/// The normalized form of the token used deriving the diff
normalized: T,
/// The original string, that should be inserted or deleted in the document.
/// The original string, that should be inserted or deleted in the document
original: String,
/// Whether the token is semantically joinable with the previous token.
/// Whether the token is semantically joinable with the previous token
pub is_left_joinable: bool,
/// Whether the token is semantically joinable with the next token.
/// Whether the token is semantically joinable with the next token
pub is_right_joinable: bool,
}
/// Trivial implementation of Token when the normalized form is the same as the
/// original string.
/// original string
impl From<&str> for Token<String> {
fn from(text: &str) -> Self { Token::new(text.to_owned(), text.to_owned(), true, true) }
}

View file

@ -1,7 +1,7 @@
use super::token::Token;
/// Splits text on word boundaries, creating tokens of alternating words and
/// whitespace with the whitespace getting unique IDs.
/// whitespace with the whitespace getting unique IDs
///
/// ## Example
///