fn instanceof(subtype: NodeVariant, supertype: NodeVariant) -> bool {
    let mut cur = subtype;
    loop {
        if cur == supertype {
            return true;
        }
        match cur.parent() {
            None => return false,
            Some(next) => {
                cur = next;
            }
        }
    }
}
/// Return whether `subtype` contains `supertype` in its parent chain.
Return whether `subtype` contains `supertype` in its parent chain.
Return whether ` subtype ` contains ` supertype ` in its parent chain .
fn instanceof(subtype: NodeVariant, supertype: NodeVariant) -> bool {
    let mut cur = subtype;
    loop {
        if cur == supertype {
            return true;
        }
        match cur.parent() {
            None => return false,
            Some(next) => {
                cur = next;
            }
        }
    }
}
fn instanceof ( subtype : NodeVariant , supertype : NodeVariant ) -> bool { let mut cur = subtype ; loop { if cur == supertype { return true ; } match cur . parent ( ) { None => return false , Some ( next ) => { cur = next ; } } } }
Return whether `subtype` contains `supertype` in its parent chain.
Return whether ` subtype ` contains ` supertype ` in its parent chain .
subtype
NodeVariant
supertype
NodeVariant
subtype
NodeVariant
supertype
NodeVariant