pub fn ancestry(&self, other: &Self) -> (Self, Self) {
        let mut a = self.iter();
        let mut b = other.iter();

        let mut shared = Item::new();
        let mut suffix = Item::new();

        while let Some(v) = b.next() {
            if let Some(u) = a.next() {
                if u == v {
                    shared.push(v);
                    continue;
                } else {
                    suffix.push(v);
                    suffix.extend(b);
                    return (shared, suffix);
                }
            }

            suffix.push(v);
            break;
        }

        suffix.extend(b);
        (shared, suffix)
    }
/// Get the ancestry of one module to another.
///
/// This returns three things:
/// * The shared prefix between the current and the `other` path.
/// * The suffix to get to the `other` path from the shared prefix.
Get the ancestry of one module to another.
This returns three things:
The shared prefix between the current and the `other` path.
The suffix to get to the `other` path from the shared prefix.
Get the ancestry of one module to another . This returns three things : The shared prefix between the current and the ` other ` path . The suffix to get to the ` other ` path from the shared prefix .
pub fn ancestry(&self, other: &Self) -> (Self, Self) {
        let mut a = self.iter();
        let mut b = other.iter();
        let mut shared = Item::new();
        let mut suffix = Item::new();
        while let Some(v) = b.next() {
            if let Some(u) = a.next() {
                if u == v {
                    shared.push(v);
                    continue;
                } else {
                    suffix.push(v);
                    suffix.extend(b);
                    return (shared, suffix);
                }
            }
            suffix.push(v);
            break;
        }
        suffix.extend(b);
        (shared, suffix)
    }
pub fn ancestry ( & self , other : & Self ) -> ( Self , Self ) { let mut a = self . iter ( ) ; let mut b = other . iter ( ) ; let mut shared = Item :: new ( ) ; let mut suffix = Item :: new ( ) ; while let Some ( v ) = b . next ( ) { if let Some ( u ) = a . next ( ) { if u == v { shared . push ( v ) ; continue ; } else { suffix . push ( v ) ; suffix . extend ( b ) ; return ( shared , suffix ) ; } } suffix . push ( v ) ; break ; } suffix . extend ( b ) ; ( shared , suffix ) }
Get the ancestry of one module to another.
Get the ancestry of one module to another .
&self
other
&Self
&self
other
&Self