Modern Apps git

← Modern-Apps.git

dem_ingest: fix all cargo check and clippy warnings

Commit
39893cd92bb561cd8db262baeb5f2329e7a59624
Author
Vayun Mathur <[email protected]>
When
2026-11-17 14:18 UTC (18 days ago)
Parents
d263038
TileGrid/ChunkResult type aliases. Verified: check/clippy --all-targets 0 warnings, test 5 passed.

Diff

scripts/maps/dem_ingest/src/main.rs
diff --git a/scripts/maps/dem_ingest/src/main.rs b/scripts/maps/dem_ingest/src/main.rsindex 35b58db727..f7dea852d5 100644--- a/scripts/maps/dem_ingest/src/main.rs+++ b/scripts/maps/dem_ingest/src/main.rs@@ -44,6 +44,11 @@ use sample::{sample_tile, DemCache}; mod tilemath; use tilemath::{lat_to_tile_y, lon_to_tile_x}; +/// One kept tile: pmtiles tile id plus its `dim * dim` height samples.+type TileGrid = (u64, Vec<u16>);+/// Per-chunk sample result: kept tiles plus the count with no DEM coverage.+type ChunkResult = (Vec<TileGrid>, u64);+ /// Default DEM input, relative to the repo's `scripts/maps/` working dir. const DEFAULT_INPUT: &str = "inputs/cop90/COP90_hh.vrt"; @@ -108,11 +113,11 @@ fn run() -> Result<(), String> {     let done = std::sync::atomic::AtomicU64::new(0);     let start = std::time::Instant::now(); -    let chunks: Vec<(Vec<(u64, Vec<u16>)>, u64)> = ids+    let chunks: Vec<ChunkResult> = ids         .par_chunks(chunk_size)-        .map(|chunk| -> Result<(Vec<(u64, Vec<u16>)>, u64), String> {+        .map(|chunk| -> Result<ChunkResult, String> {             let mut cache = DemCache::new();-            let mut kept: Vec<(u64, Vec<u16>)> = Vec::new();+            let mut kept: Vec<TileGrid> = Vec::new();             let mut missing = 0u64;             for &id in chunk {                 let (_, x, y) = tile_zxy(id);@@ -133,7 +138,7 @@ fn run() -> Result<(), String> {      // Merge in chunk (ascending id) order; the sort keeps the body byte-identical     // to the serial walk regardless of how chunks were scheduled.-    let mut tiles: Vec<(u64, Vec<u16>)> = Vec::new();+    let mut tiles: Vec<TileGrid> = Vec::new();     let mut missing = 0u64;     for (kept, chunk_missing) in chunks {         tiles.extend(kept);