From b5092f0eea0bd72ac28496444d461d64309adf99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Gir=C3=A1ldez?= Date: Fri, 12 Apr 2024 20:54:59 +0000 Subject: [PATCH] Update main.rs for clarity --- rust/aggregate-population/src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rust/aggregate-population/src/main.rs b/rust/aggregate-population/src/main.rs index 692dd3b4..39b146af 100644 --- a/rust/aggregate-population/src/main.rs +++ b/rust/aggregate-population/src/main.rs @@ -57,8 +57,9 @@ fn aggregate_band(dataset: Dataset, band_no: isize) -> errors::Result<(f64, f32) unsafe { data.set_len(pixels); }; - let raw_data = data.as_slice(); + // End low-level, unsafe section of code + for iy in 0..span_y { for ix in 0..span_x { let value = raw_data[ix + iy * block_x_size];