Skip to main content

write_names

Function write_names 

Source
pub fn write_names(
    config_path: &Path,
    path: &str,
    wanted: &[(String, Vec<String>)],
    shipped: &[(String, Vec<String>)],
) -> Result<(), String>
Expand description

Writes a named list’s changes (MAPS: brands and their domains, bodies and their words) so that it holds wanted, compared with what the packs alone give (shipped), names and words folded: a name not shipped goes to add with its words; a shipped name not wanted to remove; a shipped name given more words, those words to add; a shipped name given fewer, to remove and back in add with the words wanted (added wins). Wanting the shipped list takes the changes out.