pub fn head_intersects(&self) -> bool {
        let head = self.segments[0];

        // For all segments other than the first, it must be different from the
        // first.
        self.segments.iter().skip(1).any(|segment| *segment == head)
    }
/// Tests if the head intersects the rest of the body.
Tests if the head intersects the rest of the body.
Tests if the head intersects the rest of the body .
pub fn head_intersects(&self) -> bool {
        let head = self.segments[0];
        // For all segments other than the first, it must be different from the
        // first.
        self.segments.iter().skip(1).any(|segment| *segment == head)
    }
pub fn head_intersects ( & self ) -> bool { let head = self . segments [ 0 ] ; // For all segments other than the first, it must be different from the // first. self . segments . iter ( ) . skip ( 1 ) . any ( | segment | * segment == head ) }
Tests if the head intersects the rest of the body.
Tests if the head intersects the rest of the body .
&self
&self