garden-tools 0.8.1

Garden grows and cultivates collections of Git trees Garden lets you define and run commands over collections of configuration-defined multi-worktree Git environments.
Documentation
use indexmap::IndexSet;

use std::collections::HashMap;

/// Update a IndexSet "a" with the values from "b"
#[inline]
pub fn append_indexset<T>(a: &mut IndexSet<T>, b: &IndexSet<T>)
where
    T: Clone + Eq + Ord + std::hash::Hash,
{
    for value in b {
        a.insert(value.clone());
    }
}

/// Update a Hashmap "a" with the values from "b".
#[inline]
pub fn append_hashmap<K, V>(a: &mut HashMap<K, V>, b: &HashMap<K, V>)
where
    K: Clone + Eq + Ord + std::hash::Hash,
    V: Clone,
{
    for (key, value) in b {
        a.insert(key.clone(), value.clone());
    }
}