Remove errors

This commit is contained in:
Andras Schmelczer 2024-11-29 22:26:18 +00:00
commit 35be112de2
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
6 changed files with 28 additions and 56 deletions

View file

@ -5,9 +5,9 @@ mod operation;
pub use edited_text::EditedText;
pub use operation::Operation;
use crate::{errors::SyncLibError, tokenizer::Tokenizer};
use crate::tokenizer::Tokenizer;
pub fn reconcile(original: &str, left: &str, right: &str) -> Result<String, SyncLibError> {
pub fn reconcile(original: &str, left: &str, right: &str) -> String {
let left_operations = EditedText::from_strings(original, left);
let right_operations = EditedText::from_strings(original, right);
@ -20,7 +20,7 @@ pub fn reconcile_with_tokenizer<F, T>(
left: &str,
right: &str,
tokenizer: &Tokenizer<T>,
) -> Result<String, SyncLibError>
) -> String
where
T: PartialEq + Clone,
{
@ -175,11 +175,11 @@ mod test {
})
.collect::<Vec<_>>();
reconcile(&contents[0], &contents[1], &contents[2]).unwrap();
reconcile(&contents[0], &contents[1], &contents[2]);
}
fn test_merge_both_ways(original: &str, edit_1: &str, edit_2: &str, expected: &str) {
assert_eq!(reconcile(original, edit_1, edit_2).unwrap(), expected);
assert_eq!(reconcile(original, edit_2, edit_1).unwrap(), expected);
assert_eq!(reconcile(original, edit_1, edit_2), expected);
assert_eq!(reconcile(original, edit_2, edit_1), expected);
}
}