/// Triangulate the polygon given as a list of `Point`s describing its sides.
///
/// Returns `None` if the given iterator yields less than two points.
Triangulate the polygon given as a list of `Point`s describing its sides.
Returns `None` if the given iterator yields less than two points.
Triangulate the polygon given as a list of ` Point ` s describing its sides . Returns ` None ` if the given iterator yields less than two points .
pub fn triangles<I>(points: I) -> Option<Triangles<I::IntoIter>>
where
    I: IntoIterator,
{
    let mut points = points.into_iter();
    let first = match points.next() {
        Some(p) => p,
        None => return None,
    };
    let prev = match points.next() {
        Some(p) => p,
        None => return None,
    };
    Some(Triangles {
        first: first,
        prev: prev,
        points: points,
    })
}
pub fn triangles < I > ( points : I ) -> Option < Triangles < I :: IntoIter > > where I : IntoIterator , { let mut points = points . into_iter ( ) ; let first = match points . next ( ) { Some ( p ) => p , None => return None , } ; let prev = match points . next ( ) { Some ( p ) => p , None => return None , } ; Some ( Triangles { first : first , prev : prev , points : points , } ) }
Triangulate the polygon given as a list of `Point`s describing its sides.
Triangulate the polygon given as a list of ` Point ` s describing its sides .
points
I