i_shape 2.0.0

iShape is a compact and efficient library specifically designed for representing 2D data structures using IntPoint.
Documentation
use crate::fix::path::FixPath;
use alloc::vec::Vec;

pub type FixPaths = Vec<FixPath>;

pub trait FixPathsExtension {
    fn points_count(&self) -> usize;
}

impl FixPathsExtension for FixPaths {
    #[inline(always)]
    fn points_count(&self) -> usize {
        self.iter().fold(0, |acc, x| acc + x.len())
    }
}

impl FixPathsExtension for [FixPath] {
    #[inline(always)]
    fn points_count(&self) -> usize {
        self.iter().fold(0, |acc, x| acc + x.len())
    }
}