pub fn new(
        op: Operation,
        x: usize,
        y: usize,
        original_content: Vec<String>,
        modified_content: Vec<String>,
    ) -> Edit {
        match op {
            Operation::Insert => Edit {
                op,
                original: HalfEdit {
                    line: x,
                    content: vec![],
                },
                modified: HalfEdit {
                    line: y,
                    content: modified_content,
                },
            },
            Operation::Delete => Edit {
                op,
                original: HalfEdit {
                    line: x,
                    content: original_content,
                },
                modified: HalfEdit {
                    line: y,
                    content: vec![],
                },
            },
            Operation::Replace => Edit {
                op,
                original: HalfEdit {
                    line: x,
                    content: original_content,
                },
                modified: HalfEdit {
                    line: y,
                    content: modified_content,
                },
            },
        }
    }
/// create an edit given an op, line numbers, and content
// TODO: error check that for insert and delete edit, modified/original is exclusive, just for
// error keeping sake.
create an edit given an op, line numbers, and content
TODO: error check that for insert and delete edit, modified/original is exclusive, just for
error keeping sake.
create an edit given an op line numbers and content TODO : error check that for insert and delete edit modified / original is exclusive just for error keeping sake .
pub fn new(
        op: Operation,
        x: usize,
        y: usize,
        original_content: Vec<String>,
        modified_content: Vec<String>,
    ) -> Edit {
        match op {
            Operation::Insert => Edit {
                op,
                original: HalfEdit {
                    line: x,
                    content: vec![],
                },
                modified: HalfEdit {
                    line: y,
                    content: modified_content,
                },
            },
            Operation::Delete => Edit {
                op,
                original: HalfEdit {
                    line: x,
                    content: original_content,
                },
                modified: HalfEdit {
                    line: y,
                    content: vec![],
                },
            },
            Operation::Replace => Edit {
                op,
                original: HalfEdit {
                    line: x,
                    content: original_content,
                },
                modified: HalfEdit {
                    line: y,
                    content: modified_content,
                },
            },
        }
    }
pub fn new ( op : Operation , x : usize , y : usize , original_content : Vec < String > , modified_content : Vec < String > , ) -> Edit { match op { Operation :: Insert => Edit { op , original : HalfEdit { line : x , content : vec ! [ ] , } , modified : HalfEdit { line : y , content : modified_content , } , } , Operation :: Delete => Edit { op , original : HalfEdit { line : x , content : original_content , } , modified : HalfEdit { line : y , content : vec ! [ ] , } , } , Operation :: Replace => Edit { op , original : HalfEdit { line : x , content : original_content , } , modified : HalfEdit { line : y , content : modified_content , } , } , } }
create an edit given an op, line numbers, and content
TODO: error check that for insert and delete edit, modified/original is exclusive, just for
error keeping sake.
create an edit given an op line numbers and content TODO : error check that for insert and delete edit modified / original is exclusive just for error keeping sake .
op
Operation
x
usize
y
usize
original_content
Vec<String>
modified_content
Vec<String>
op
Operation
x
usize
y
usize
original_content
Vec<String>
modified_content
Vec<String>