Bump rust edition & reformat
This commit is contained in:
parent
13d5b35d1a
commit
f4a87d073a
15 changed files with 44 additions and 45 deletions
|
|
@ -3,5 +3,5 @@ mod operation_transformation;
|
|||
mod tokenizer;
|
||||
mod utils;
|
||||
|
||||
pub use operation_transformation::{reconcile, reconcile_with_tokenizer, EditedText};
|
||||
pub use operation_transformation::{EditedText, reconcile, reconcile_with_tokenizer};
|
||||
pub use tokenizer::token::Token;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use super::Operation;
|
|||
use crate::{
|
||||
diffs::{myers::diff, raw_operation::RawOperation},
|
||||
operation_transformation::merge_context::MergeContext,
|
||||
tokenizer::{word_tokenizer::word_tokenizer, Tokenizer},
|
||||
tokenizer::{Tokenizer, word_tokenizer::word_tokenizer},
|
||||
utils::{
|
||||
merge_iters::MergeSorted as _, ordered_operation::OrderedOperation, side::Side,
|
||||
string_builder::StringBuilder,
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ use serde::{Deserialize, Serialize};
|
|||
|
||||
use super::merge_context::MergeContext;
|
||||
use crate::{
|
||||
utils::{find_common_overlap::find_common_overlap, string_builder::StringBuilder},
|
||||
Token,
|
||||
utils::{find_common_overlap::find_common_overlap, string_builder::StringBuilder},
|
||||
};
|
||||
|
||||
/// Represents a change that can be applied to a text document.
|
||||
|
|
@ -355,9 +355,11 @@ mod tests {
|
|||
#[test]
|
||||
#[should_panic]
|
||||
fn test_shifting_error() {
|
||||
insta::assert_debug_snapshot!(Operation::create_insert(1, vec!["hi".into()])
|
||||
.unwrap()
|
||||
.with_shifted_index(-2));
|
||||
insta::assert_debug_snapshot!(
|
||||
Operation::create_insert(1, vec!["hi".into()])
|
||||
.unwrap()
|
||||
.with_shifted_index(-2)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -40,26 +40,29 @@ mod tests {
|
|||
assert_eq!(find_common_overlap(&["".into()], &["".into()]), 0);
|
||||
|
||||
assert_eq!(
|
||||
find_common_overlap(
|
||||
&["a".into(), "b".into(), "c".into()],
|
||||
&["b".into(), "c".into(), "a".into()]
|
||||
),
|
||||
find_common_overlap(&["a".into(), "b".into(), "c".into()], &[
|
||||
"b".into(),
|
||||
"c".into(),
|
||||
"a".into()
|
||||
]),
|
||||
1
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
find_common_overlap(
|
||||
&["a".into(), "a".into(), "a".into()],
|
||||
&["a".into(), "b".into(), "c".into()]
|
||||
),
|
||||
find_common_overlap(&["a".into(), "a".into(), "a".into()], &[
|
||||
"a".into(),
|
||||
"b".into(),
|
||||
"c".into()
|
||||
]),
|
||||
2
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
find_common_overlap(
|
||||
&["a".into(), "b".into(), "c".into()],
|
||||
&["d".into(), "e".into(), "a".into()]
|
||||
),
|
||||
find_common_overlap(&["a".into(), "b".into(), "c".into()], &[
|
||||
"d".into(),
|
||||
"e".into(),
|
||||
"a".into()
|
||||
]),
|
||||
3
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue