pub fn vec_diff_simple(v1: &[Value], v2: &[Value], ty: &Option<Type>) -> Vec<VecEdit<RcValueEdit>> {
    let mut edits = vec![];
    let prefix_len = v1.len().min(v2.len());
    let ty = match ty {
        None => None,
        Some(Type::Vec(t)) => Some((**t).clone()),
        _ => {
            error!("invalid type");
            None
        }
    };
    for i in 0..prefix_len {
        let edit = value_diff(&v1[i], &v2[i], &ty);
        if !value_edit_is_skip(&edit) {
            edits.push(VecEdit::EditValue(i, edit))
        }
    }
    if v1.len() > v2.len() {
        for (i, v1i) in v1.iter().enumerate().skip(prefix_len) {
            edits.push(VecEdit::InsertValue(i, v1i.clone()))
        }
    } else {
        for (i, v2i) in v2.iter().enumerate().skip(prefix_len) {
            edits.push(VecEdit::InsertValue(i, v2i.clone()))
        }
    }
    edits
}
/// Simple algorithm for computing a naive edit
///
/// Limitations:
///  - No alignment; over-uses in-place edits.
///  - No removal edits used within the output (yet).
///  - All insertions at the end (if any).
///
Simple algorithm for computing a naive edit
Limitations:
No alignment; over-uses in-place edits.
No removal edits used within the output (yet).
All insertions at the end (if any).
Simple algorithm for computing a naive edit Limitations : No alignment ; over - uses in - place edits . No removal edits used within the output ( yet ) . All insertions at the end ( if any ) .
pub fn vec_diff_simple(v1: &[Value], v2: &[Value], ty: &Option<Type>) -> Vec<VecEdit<RcValueEdit>> {
    let mut edits = vec![];
    let prefix_len = v1.len().min(v2.len());
    let ty = match ty {
        None => None,
        Some(Type::Vec(t)) => Some((**t).clone()),
        _ => {
            error!("invalid type");
            None
        }
    };
    for i in 0..prefix_len {
        let edit = value_diff(&v1[i], &v2[i], &ty);
        if !value_edit_is_skip(&edit) {
            edits.push(VecEdit::EditValue(i, edit))
        }
    }
    if v1.len() > v2.len() {
        for (i, v1i) in v1.iter().enumerate().skip(prefix_len) {
            edits.push(VecEdit::InsertValue(i, v1i.clone()))
        }
    } else {
        for (i, v2i) in v2.iter().enumerate().skip(prefix_len) {
            edits.push(VecEdit::InsertValue(i, v2i.clone()))
        }
    }
    edits
}
pub fn vec_diff_simple ( v1 : & [ Value ] , v2 : & [ Value ] , ty : & Option < Type > ) -> Vec < VecEdit < RcValueEdit > > { let mut edits = vec ! [ ] ; let prefix_len = v1 . len ( ) . min ( v2 . len ( ) ) ; let ty = match ty { None => None , Some ( Type :: Vec ( t ) ) => Some ( ( * * t ) . clone ( ) ) , _ => { error ! ( " " ) ; None } } ; for i in 0 .. prefix_len { let edit = value_diff ( & v1 [ i ] , & v2 [ i ] , & ty ) ; if ! value_edit_is_skip ( & edit ) { edits . push ( VecEdit :: EditValue ( i , edit ) ) } } if v1 . len ( ) > v2 . len ( ) { for ( i , v1i ) in v1 . iter ( ) . enumerate ( ) . skip ( prefix_len ) { edits . push ( VecEdit :: InsertValue ( i , v1i . clone ( ) ) ) } } else { for ( i , v2i ) in v2 . iter ( ) . enumerate ( ) . skip ( prefix_len ) { edits . push ( VecEdit :: InsertValue ( i , v2i . clone ( ) ) ) } } edits }
Simple algorithm for computing a naive edit
Limitations:
 No alignment; over-uses in-place edits.
Simple algorithm for computing a naive edit Limitations : No alignment ; over - uses in - place edits .
v1
&[Value]
v2
&[Value]
ty
&Option<Type>
v1
&[Value]
v2
&[Value]
ty
&Option<Type>