imgdata: make new_from_grid not take a reference

This commit is contained in:
Simon Gardling 2025-03-28 10:29:49 -04:00
parent e3fff76792
commit e6cfab4a02
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -12,16 +12,16 @@ pub struct ThinGridData {
impl ThinGridData {
/// Convert Grid to ThinGridData
pub fn new_from_grid(in_grid: &Grid) -> Self {
pub fn new_from_grid(in_grid: Grid) -> Self {
ThinGridData {
width: in_grid.width,
height: in_grid.height,
data: in_grid.data.clone(),
data: in_grid.data,
}
}
pub fn new_from_grid_vec(in_grids: &[Grid]) -> Vec<Self> {
in_grids.iter().map(Self::new_from_grid).collect()
in_grids.iter().cloned().map(Self::new_from_grid).collect()
}
/// from grid.rs (needed in image gen)