pub fn push_middleware_to_populated_nodes(&mut self, other_node: &Node<T>, accumulated_middleware: &MiddlewareChain<T>) {
    let fake_node = Node::new("");

    let accumulating_chain = if other_node.runnable.is_assigned() {
      let mut accumulating_chain = other_node.runnable.clone();
      accumulating_chain.chain(accumulated_middleware.clone());
      accumulating_chain
    } else {
      accumulated_middleware.clone()
    };

    if self.runnable.is_assigned() {
      let mut other = other_node.runnable.clone();
      let mut other_2 = other.clone();
      let mut accumulating_chain = accumulated_middleware.clone();
      let old = self.runnable.clone();

      other_2.chain(old);
      accumulating_chain.chain(other_2);
      other.chain(accumulating_chain);

      self.runnable = other;
    }

    // Match children, recurse if child match
    for (key, child) in &mut self.children {
      // Traverse the child tree, or else make a dummy node
      let other_child = other_node.children.get(key).unwrap_or(&fake_node);

      child.push_middleware_to_populated_nodes(other_child, &accumulating_chain.clone());
    }

    // Copy over wildcards
    if let Some(ref mut wildcard_node) = self.wildcard_node {
      if let Some(other_wildcard_node) = &other_node.wildcard_node {
        wildcard_node.push_middleware_to_populated_nodes(other_wildcard_node, &accumulating_chain.clone());
      }
    }
  }
///
/// Pushes middleware down to the leaf nodes, accumulating along the way. This is helpful for
/// propagating generic middleware down the stack
///
Pushes middleware down to the leaf nodes, accumulating along the way. This is helpful for
propagating generic middleware down the stack
Pushes middleware down to the leaf nodes accumulating along the way . This is helpful for propagating generic middleware down the stack
pub fn push_middleware_to_populated_nodes(&mut self, other_node: &Node<T>, accumulated_middleware: &MiddlewareChain<T>) {
    let fake_node = Node::new("");
    let accumulating_chain = if other_node.runnable.is_assigned() {
      let mut accumulating_chain = other_node.runnable.clone();
      accumulating_chain.chain(accumulated_middleware.clone());
      accumulating_chain
    } else {
      accumulated_middleware.clone()
    };
    if self.runnable.is_assigned() {
      let mut other = other_node.runnable.clone();
      let mut other_2 = other.clone();
      let mut accumulating_chain = accumulated_middleware.clone();
      let old = self.runnable.clone();
      other_2.chain(old);
      accumulating_chain.chain(other_2);
      other.chain(accumulating_chain);
      self.runnable = other;
    }
    // Match children, recurse if child match
    for (key, child) in &mut self.children {
      // Traverse the child tree, or else make a dummy node
      let other_child = other_node.children.get(key).unwrap_or(&fake_node);
      child.push_middleware_to_populated_nodes(other_child, &accumulating_chain.clone());
    }
    // Copy over wildcards
    if let Some(ref mut wildcard_node) = self.wildcard_node {
      if let Some(other_wildcard_node) = &other_node.wildcard_node {
        wildcard_node.push_middleware_to_populated_nodes(other_wildcard_node, &accumulating_chain.clone());
      }
    }
  }
pub fn push_middleware_to_populated_nodes ( & mut self , other_node : & Node < T > , accumulated_middleware : & MiddlewareChain < T > ) { let fake_node = Node :: new ( " " ) ; let accumulating_chain = if other_node . runnable . is_assigned ( ) { let mut accumulating_chain = other_node . runnable . clone ( ) ; accumulating_chain . chain ( accumulated_middleware . clone ( ) ) ; accumulating_chain } else { accumulated_middleware . clone ( ) } ; if self . runnable . is_assigned ( ) { let mut other = other_node . runnable . clone ( ) ; let mut other_2 = other . clone ( ) ; let mut accumulating_chain = accumulated_middleware . clone ( ) ; let old = self . runnable . clone ( ) ; other_2 . chain ( old ) ; accumulating_chain . chain ( other_2 ) ; other . chain ( accumulating_chain ) ; self . runnable = other ; } // Match children, recurse if child match for ( key , child ) in & mut self . children { // Traverse the child tree, or else make a dummy node let other_child = other_node . children . get ( key ) . unwrap_or ( & fake_node ) ; child . push_middleware_to_populated_nodes ( other_child , & accumulating_chain . clone ( ) ) ; } // Copy over wildcards if let Some ( ref mut wildcard_node ) = self . wildcard_node { if let Some ( other_wildcard_node ) = & other_node . wildcard_node { wildcard_node . push_middleware_to_populated_nodes ( other_wildcard_node , & accumulating_chain . clone ( ) ) ; } } }
Pushes middleware down to the leaf nodes, accumulating along the way.
Pushes middleware down to the leaf nodes accumulating along the way .
&mut self
other_node
&Node<T>
accumulated_middleware
&MiddlewareChain<T>
&mut self
other_node
&Node<T>
accumulated_middleware
&MiddlewareChain<T>