nd_vector 0.1.0

[WIP] Lengthen! Shrink! Iterate! Scale! Twist and turn to your imagination along any dimension on a vector!
Documentation
use std::{num::NonZeroUsize, ops::Range};


use crate::vector_grid::VectorGrid;


impl<ItemType> VectorGrid<ItemType> {
    pub(crate) fn cut_columns(&mut self, column_range: Range<usize>) {
        if column_range.end > self.width().get() {
            panic!("Range of columns to cut goes beyond the maps width")
        }

        let cut_width = column_range.end - column_range.start;
        let mut i = column_range.start;
        self.width = NonZeroUsize::new(self.width.get() - cut_width).unwrap();
        while i < self.items.len() {
            self.items
                .splice(i..(i + cut_width).min(self.items.len()), []);
            i += self.width().get();
        }
    }
}