dochy_diff 0.10.1

Calculates Dochy Diff.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use dochy_core::structs::{Qv, MetaTable, RefSabValue};
use dochy_core::HashM;
use crate::diff_error::DiffError;

pub(crate) fn apply_refs(refs : Vec<(usize, Qv<String>)>, meta : &MetaTable,
                  r : &mut HashM<String, RefSabValue>) -> Result<(), DiffError>{

    for (id, qv) in refs{
        let (key, _) = if let Some(v) = meta.get(id){ v } else{
            Err("meta is invalid apply_refs")?
        };
        r.insert(key.to_string(), RefSabValue::new(qv));
    }
    Ok(())
}