···8787}
88888989fn push_from_node(stack: &mut Vec<Need>, node: &Node, parent_depth: Depth) -> Result<(), MstError> {
9090- // empty nodes are not allowed in the MST
9191- // ...except for a single one for empty MST, but we wouldn't be pushing that
9090+ // empty nodes are not allowed in the MST except in an empty MST
9291 if node.is_empty() {
9393- return Err(MstError::EmptyNode);
9292+ if parent_depth == Depth::Root {
9393+ return Ok(()); // empty mst, nothing to push
9494+ } else {
9595+ return Err(MstError::EmptyNode);
9696+ }
9497 }
95989699 let mut entries = Vec::with_capacity(node.entries.len());