pub fn extend_nodes(
        old: Option<BTreeMap<C::NodeId, Node>>,
        new: &Option<BTreeMap<C::NodeId, Node>>,
    ) -> Option<BTreeMap<C::NodeId, Node>> {
        let new_nodes = match new {
            None => return old,
            Some(x) => x,
        };

        let mut res = old.unwrap_or_default();

        for (k, v) in new_nodes.iter() {
            if res.contains_key(k) {
                continue;
            }
            res.insert(*k, v.clone());
        }

        Some(res)
    }
/// Extends nodes with another.
///
/// Node that present in `old` will not be replaced because changing the address of a node potentially breaks
/// consensus guarantee.
Extends nodes with another.
Node that present in `old` will not be replaced because changing the address of a node potentially breaks
consensus guarantee.
Extends nodes with another . Node that present in ` old ` will not be replaced because changing the address of a node potentially breaks consensus guarantee .
pub fn extend_nodes(
        old: Option<BTreeMap<C::NodeId, Node>>,
        new: &Option<BTreeMap<C::NodeId, Node>>,
    ) -> Option<BTreeMap<C::NodeId, Node>> {
        let new_nodes = match new {
            None => return old,
            Some(x) => x,
        };
        let mut res = old.unwrap_or_default();
        for (k, v) in new_nodes.iter() {
            if res.contains_key(k) {
                continue;
            }
            res.insert(*k, v.clone());
        }
        Some(res)
    }
pub fn extend_nodes ( old : Option < BTreeMap < C :: NodeId , Node > > , new : & Option < BTreeMap < C :: NodeId , Node > > , ) -> Option < BTreeMap < C :: NodeId , Node > > { let new_nodes = match new { None => return old , Some ( x ) => x , } ; let mut res = old . unwrap_or_default ( ) ; for ( k , v ) in new_nodes . iter ( ) { if res . contains_key ( k ) { continue ; } res . insert ( * k , v . clone ( ) ) ; } Some ( res ) }
Extends nodes with another.
Extends nodes with another .
old
Option<BTreeMap<C::NodeId, Node>>
new
&Option<BTreeMap<C::NodeId, Node>>