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

@ -3,7 +3,7 @@ use std::fmt::Debug;
use crate::Token;
/// Given two lists of tokens, returns `length` where the `old` list
/// somewhere within contains the `length` prefix of the `new` list.
/// somewhere within contains the `length` prefix of the `new` list
///
/// ## Example
///

View file

@ -77,7 +77,7 @@ where
/// We can't use a traditional Vec to represent `V` since we use `k` as an index
/// and it can take on negative values. So instead `V` is represented as a
/// light-weight wrapper around a Vec plus an `offset` which is the maximum
/// value `k` can take on in order to map negative `k`'s back to a value >= 0.
/// value `k` can take on to map negative `k`'s back to a value >= 0.
#[derive(Debug)]
struct V {
offset: isize,

View file

@ -34,11 +34,11 @@ impl StringBuilder<'_> {
}
}
/// Insert a string at the end of the built buffer.
/// Insert a string at the end of the built buffer
pub fn insert(&mut self, text: &str) { self.buffer.push_str(text); }
/// Skip copying `length` characters from the original string to the built
/// buffer.
/// buffer
pub fn delete(&mut self, length: usize) {
if length == 0 {
return;
@ -52,7 +52,7 @@ impl StringBuilder<'_> {
}
}
/// Copy `length` characters from the original string to the built buffer.
/// Copy `length` characters from the original string to the built buffer
pub fn retain(&mut self, length: usize) {
self.buffer.extend(self.original.by_ref().take(length));