Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
449 changes: 434 additions & 15 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions crates/lovely-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ serde_ignored = "0.1.10"
itertools = "0.13.0"
crop = "0.4.2"
anyhow = "1.0.100"
zip = "6.0.0"

[dev-dependencies]
criterion = { version = "0.7", default-features = false }
tempfile = "3"

[[bench]]
name = "patches"
Expand Down
10 changes: 5 additions & 5 deletions crates/lovely-core/src/chunk_vec_cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl<'a> regex_cursor::Cursor for ChunkVecCursor<'a> {

fn advance(&mut self) -> bool {
if self.idx + 1 >= self.chunks.len() {
return false
return false;
}
self.offset += self.chunks[self.idx].len();
self.idx += 1;
Expand All @@ -29,7 +29,7 @@ impl<'a> regex_cursor::Cursor for ChunkVecCursor<'a> {

fn backtrack(&mut self) -> bool {
if self.idx == 0 {
return false
return false;
}
self.idx -= 1;
self.offset -= self.chunks[self.idx].len();
Expand All @@ -47,7 +47,7 @@ impl<'a> regex_cursor::Cursor for ChunkVecCursor<'a> {

impl<'a> IntoCursor for &'a crop::Rope {
type Cursor = ChunkVecCursor<'a>;

fn into_cursor(self) -> Self::Cursor {
ChunkVecCursor {
chunks: self.chunks().collect_vec(),
Expand All @@ -60,7 +60,7 @@ impl<'a> IntoCursor for &'a crop::Rope {

impl<'a> IntoCursor for crop::RopeSlice<'a> {
type Cursor = ChunkVecCursor<'a>;

fn into_cursor(self) -> Self::Cursor {
ChunkVecCursor {
chunks: self.chunks().collect_vec(),
Expand All @@ -69,4 +69,4 @@ impl<'a> IntoCursor for crop::RopeSlice<'a> {
offset: 0,
}
}
}
}
Loading
Loading