/// Helper function for walking the tree up from some starting `MdNode`, all the way up
/// to the root of the tree.
Helper function for walking the tree up from some starting `MdNode`, all the way up
to the root of the tree.
Helper function for walking the tree up from some starting ` MdNode ` all the way up to the root of the tree .
fn walk_ancestors(parent: Option<&Weak<RefCell<MdNode>>>, cb: &mut impl FnMut(MdNodeRef)) {
    if let Some(parent) = parent.and_then(|x| x.upgrade()) {
        cb(parent.clone().into());
        walk_ancestors(parent.borrow().parent.as_ref(), cb)
    }
}
fn walk_ancestors ( parent : Option < & Weak < RefCell < MdNode > > > , cb : & mut impl FnMut ( MdNodeRef ) ) { if let Some ( parent ) = parent . and_then ( | x | x . upgrade ( ) ) { cb ( parent . clone ( ) . into ( ) ) ; walk_ancestors ( parent . borrow ( ) . parent . as_ref ( ) , cb ) } }
Helper function for walking the tree up from some starting `MdNode`, all the way up
to the root of the tree.
Helper function for walking the tree up from some starting ` MdNode ` all the way up to the root of the tree .
parent
Option<&Weak<RefCell<MdNode>>>
cb
&mut impl FnMut(MdNodeRef)