Update imports

This commit is contained in:
Andras Schmelczer 2025-06-29 15:30:35 +01:00
parent b53aa0c2b2
commit c682520b88
3 changed files with 6 additions and 8 deletions

View file

@ -3,10 +3,10 @@ use serde::{Deserialize, Serialize};
use super::{CursorPosition, Operation, TextWithCursors};
use crate::{
diffs::{myers::diff, raw_operation::RawOperation},
operation_transformation::utils::{
cook_operations::cook_operations, elongate_operations::elongate_operations,
},
raw_operation::RawOperation,
tokenizer::{Tokenizer, word_tokenizer::word_tokenizer},
utils::{history::History, side::Side, string_builder::StringBuilder},
};
@ -65,7 +65,7 @@ where
let original_tokens = (tokenizer)(original);
let updated_tokens = (tokenizer)(&updated.text);
let diff: Vec<RawOperation<T>> = diff(&original_tokens, &updated_tokens);
let diff: Vec<RawOperation<T>> = RawOperation::vec_from(&original_tokens, &updated_tokens);
Self::new(
original,

View file

@ -1,6 +1,4 @@
use crate::{
diffs::raw_operation::RawOperation, operation_transformation::Operation, utils::side::Side,
};
use crate::{operation_transformation::Operation, raw_operation::RawOperation, utils::side::Side};
/// Turn raw operations into ordered operations while keeping track of the
/// original token's indexes.

View file

@ -1,6 +1,6 @@
use core::iter;
use crate::diffs::raw_operation::RawOperation;
use crate::raw_operation::RawOperation;
/// Elongates the operations by merging adjacent insertions and deletions that
/// can be joined. This makes the subsequent merging of operations more
@ -24,7 +24,7 @@ where
.flat_map(|next| match next {
RawOperation::Insert(..) => match maybe_previous_insert.take() {
Some(prev) if prev.is_right_joinable() && next.is_left_joinable() => {
maybe_previous_insert = Some(prev.extend(next));
maybe_previous_insert = Some(prev.join(next));
Box::new(iter::empty()) as Box<dyn Iterator<Item = RawOperation<T>>>
}
prev => {
@ -34,7 +34,7 @@ where
},
RawOperation::Delete(..) => match maybe_previous_delete.take() {
Some(prev) if prev.is_right_joinable() && next.is_left_joinable() => {
maybe_previous_delete = Some(prev.extend(next));
maybe_previous_delete = Some(prev.join(next));
Box::new(iter::empty()) as Box<dyn Iterator<Item = RawOperation<T>>>
}
prev => {