diff --git a/src/raster/buffer.rs b/src/raster/buffer.rs index 661e1326..38319648 100644 --- a/src/raster/buffer.rs +++ b/src/raster/buffer.rs @@ -221,11 +221,7 @@ impl From> for Buffer { let (cols, rows) = (shape[1], shape[0]); let data: Vec = if value.is_standard_layout() { let (data, offset) = value.into_raw_vec_and_offset(); - if let Some(offset) = offset { - data.into_iter().skip(offset).collect() - } else { - data - } + data.as_slice()[offset.unwrap_or_default()..].to_vec() } else { value.iter().copied().collect() };