From 04ff0882a3aad53f11ac899fbdfa13602b8a795d Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Sun, 24 Sep 2023 04:11:29 -0400 Subject: [PATCH] Chore: upgrade deps (#286) * upgrade deps, fix keywords/categories * just fmt * remove backends in wgpu --- Cargo.toml | 56 ++++++++++--------- android/Cargo.toml | 1 + android/gradle/lib/build.gradle | 3 +- apple/Cargo.toml | 1 + benchmarks/Cargo.toml | 1 + justfile | 8 ++- maplibre-build-tools/Cargo.toml | 1 + maplibre-demo/Cargo.toml | 1 + maplibre-winit/Cargo.toml | 1 + maplibre/Cargo.toml | 1 + maplibre/src/debug/cleanup_system.rs | 7 ++- maplibre/src/debug/queue_system.rs | 9 ++- maplibre/src/debug/render_commands.rs | 14 +++-- maplibre/src/debug/resource_system.rs | 11 ++-- maplibre/src/raster/populate_world_system.rs | 12 +++- maplibre/src/raster/queue_system.rs | 16 ++++-- maplibre/src/raster/render_commands.rs | 29 ++++++---- maplibre/src/raster/request_system.rs | 4 +- maplibre/src/raster/resource_system.rs | 5 +- maplibre/src/raster/upload_system.rs | 22 +++++--- maplibre/src/render/mod.rs | 2 +- maplibre/src/render/render_commands.rs | 12 ++-- maplibre/src/render/systems/cleanup_system.rs | 8 +-- .../src/render/systems/resource_system.rs | 9 ++- .../systems/tile_view_pattern_system.rs | 18 +++--- maplibre/src/render/systems/upload_system.rs | 11 ++-- maplibre/src/vector/mod.rs | 7 ++- maplibre/src/vector/populate_world_system.rs | 21 +++++-- maplibre/src/vector/queue_system.rs | 7 ++- maplibre/src/vector/render_commands.rs | 31 ++++++---- maplibre/src/vector/request_system.rs | 4 +- maplibre/src/vector/resource_system.rs | 11 ++-- maplibre/src/vector/upload_system.rs | 30 ++++++---- rust-toolchain.toml | 4 +- web/Cargo.toml | 1 + web/src/error.rs | 12 ++-- 36 files changed, 232 insertions(+), 159 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7c019b89d..51cfde6d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,9 +19,11 @@ members = [ description = "Maps for Desktop, Mobile and Web" version = "0.1.0" edition = "2021" -rust-version = "1.65" +# Keep this in sync with `rust-toolchain.toml` and `justfile` +rust-version = "1.72.1" license = "MIT OR Apache-2.0" -keywords = ["graphics", "science::geo"] +keywords = ["graphics", "maps", "webgl", "tiles"] +categories = ["graphics", "science::geo"] authors = ["Maximilian Ammann "] [workspace.dependencies] @@ -40,56 +42,56 @@ winit = { version = "0.27.5", default-features = false, features = [] } # # These dependencies should be updated to the latest version # -async-trait = "0.1.68" -bytemuck = "1.13.1" -bytemuck_derive = "1.4.1" +async-trait = "0.1.73" +bytemuck = "1.14.0" +bytemuck_derive = "1.5.0" cgmath = "0.18.0" cint = "0.3.1" -clap = { version = "4.3.0", features = ["derive"] } +clap = { version = "4.3.24", features = ["derive"] } console_error_panic_hook = "0.1.7" console_log = { version = "1.0.0", features = ["color"] } criterion = { version = "0.5.1", features = ["async_tokio"] } csscolorparser = { version = "0.6.2", features = ["serde", "cint"] } downcast-rs = "1.2.0" env_logger = "0.10.0" -flatbuffers = "23.1.21" +flatbuffers = "23.5.26" flatc-rust = "0.2.0" -flate2 = "1.0.26" -geo = "0.25.0" -geo-types = { version = "0.7.9", features = ["use-rstar_0_9"] } -geozero = { version = "0.9.9", default-features = false, features = ["with-mvt", "with-geo"] } +flate2 = "1.0.27" +geo = "0.26.0" +geo-types = { version = "0.7.11", features = ["use-rstar_0_9"] } +geozero = { version = "0.11.0", default-features = false, features = ["with-mvt", "with-geo"] } image = { version = "0.24", default-features = false, features = ["jpeg", "webp", "png"] } include_dir = "0.7.3" instant = { version = "0.1.12", features = ["wasm-bindgen"] } # TODO: Untrusted dependency jni = "0.21.1" -js-sys = "0.3.63" -log = "0.4.18" +js-sys = "0.3.64" +log = "0.4.20" lyon = { version = "1.0.1", features = [] } -naga = { version = "0.12.1", features = ["wgsl-in"] } +naga = { version = "0.13.0", features = ["wgsl-in"] } ndk-glue = "0.7.0" # version is required by winit. This might for winit 0.28+, see https://github.com/rust-windowing/winit#Android -png = { version = "0.17.8" } +png = { version = "0.17.10" } raw-window-handle = "0.5.2" -reqwest = { version = "0.11.18", default-features = false, features = ["rustls-tls", "gzip"] } # Use rusttls on android because cross compiling is difficult +reqwest = { version = "0.11.20", default-features = false, features = ["rustls-tls", "gzip"] } # Use rusttls on android because cross compiling is difficult reqwest-middleware-cache = "0.1.1" # FIXME: Untrusted dependency -rstar = "0.10.0" +rstar = "0.11.0" rusqlite = { version = "0.29.0" } -serde = { version = "1.0.163", features = ["derive"] } -serde_json = "1.0.96" -smallvec = "1.10.0" -thiserror = "1.0.40" -tile-grid = "0.4" -tokio = "1.28.2" # Individual features are customized in each crate -tokio-util = { version = "0.7.8", features = ["rt"] } +serde = { version = "1.0.188", features = ["derive"] } +serde_json = "1.0.107" +smallvec = "1.11.1" +thiserror = "1.0.48" +tile-grid = "0.5" +tokio = "1.32.0" # Individual features are customized in each crate +tokio-util = { version = "0.7.9", features = ["rt"] } tracing = "0.1.37" tracing-subscriber = "0.3.17" tracing-tracy = "0.10" tracing-wasm = "0.2.1" # TODO: Low quality dependency (remove in a separate PR!) -walkdir = "2.3.3" +walkdir = "2.4.0" wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" wasm-bindgen-test = "0.3" -web-sys = "0.3.63" # Individual features are customized in each crate -wgpu = "0.16.1" +web-sys = "0.3.64" # Individual features are customized in each crate +wgpu = "0.17.0" [profile.release] lto = true diff --git a/android/Cargo.toml b/android/Cargo.toml index 9aaff5d27..6a0382e5b 100644 --- a/android/Cargo.toml +++ b/android/Cargo.toml @@ -8,6 +8,7 @@ edition.workspace = true rust-version.workspace = true license.workspace = true keywords.workspace = true +categories.workspace = true authors.workspace = true [dependencies] diff --git a/android/gradle/lib/build.gradle b/android/gradle/lib/build.gradle index 365293c85..0696df43e 100644 --- a/android/gradle/lib/build.gradle +++ b/android/gradle/lib/build.gradle @@ -34,7 +34,8 @@ cargo { libname = "maplibre_android" targetDirectory = "${module}/../target" profile = "debug" - rustupChannel = "nightly-2023-03-29" // Also change the version in justfile + // This should be in sync with the justfile + rustupChannel = "nightly-2023-09-23" features { diff --git a/apple/Cargo.toml b/apple/Cargo.toml index 030fda93c..941d74bef 100644 --- a/apple/Cargo.toml +++ b/apple/Cargo.toml @@ -8,6 +8,7 @@ edition.workspace = true rust-version.workspace = true license.workspace = true keywords.workspace = true +categories.workspace = true authors.workspace = true [dependencies] diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index 24842aa14..94354988e 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -8,6 +8,7 @@ edition.workspace = true rust-version.workspace = true license.workspace = true keywords.workspace = true +categories.workspace = true authors.workspace = true [dependencies] diff --git a/justfile b/justfile index d3b24f349..ed256a5e3 100644 --- a/justfile +++ b/justfile @@ -4,10 +4,12 @@ set shell := ["bash", "-c"] -# Also change the version in android/gradle/lib/build.gradle +# Keep this in sync with `android/gradle/lib/build.gradle` +export NIGHTLY_TOOLCHAIN := "nightly-2023-09-23" -export NIGHTLY_TOOLCHAIN := "nightly-2023-03-29" -export STABLE_TOOLCHAIN := "1.65" +# Keep this in sync with `rust-toolchain.toml` and `Cargo.toml`. +# Make sure the above is newer than this. +export STABLE_TOOLCHAIN := "1.72.1" export CARGO_TERM_COLOR := "always" export RUST_BACKTRACE := "1" diff --git a/maplibre-build-tools/Cargo.toml b/maplibre-build-tools/Cargo.toml index c53e8e67d..1ac8f1c6b 100644 --- a/maplibre-build-tools/Cargo.toml +++ b/maplibre-build-tools/Cargo.toml @@ -8,6 +8,7 @@ edition.workspace = true rust-version.workspace = true license.workspace = true keywords.workspace = true +categories.workspace = true authors.workspace = true [features] diff --git a/maplibre-demo/Cargo.toml b/maplibre-demo/Cargo.toml index 60e3d3121..77f8bf831 100644 --- a/maplibre-demo/Cargo.toml +++ b/maplibre-demo/Cargo.toml @@ -8,6 +8,7 @@ edition.workspace = true rust-version.workspace = true license.workspace = true keywords.workspace = true +categories.workspace = true authors.workspace = true [features] diff --git a/maplibre-winit/Cargo.toml b/maplibre-winit/Cargo.toml index ce0b0b7fe..43de49001 100644 --- a/maplibre-winit/Cargo.toml +++ b/maplibre-winit/Cargo.toml @@ -7,6 +7,7 @@ edition.workspace = true rust-version.workspace = true license.workspace = true keywords.workspace = true +categories.workspace = true authors.workspace = true [target.'cfg(any(target_os = "macos", target_os = "ios", target_os = "linux", target_os = "android", target_os = "windows"))'.dependencies] diff --git a/maplibre/Cargo.toml b/maplibre/Cargo.toml index e8b79e56b..6c8529baa 100644 --- a/maplibre/Cargo.toml +++ b/maplibre/Cargo.toml @@ -9,6 +9,7 @@ edition.workspace = true rust-version.workspace = true license.workspace = true keywords.workspace = true +categories.workspace = true authors.workspace = true [features] diff --git a/maplibre/src/debug/cleanup_system.rs b/maplibre/src/debug/cleanup_system.rs index 06bf74214..1aa0dcf77 100644 --- a/maplibre/src/debug/cleanup_system.rs +++ b/maplibre/src/debug/cleanup_system.rs @@ -3,9 +3,10 @@ use crate::{context::MapContext, debug::TileDebugItem, render::render_phase::Ren pub fn cleanup_system(MapContext { world, .. }: &mut MapContext) { let Some(debug_tile_phase) = world .resources - .query_mut::< - &mut RenderPhase, - >() else { return; }; + .query_mut::<&mut RenderPhase>() + else { + return; + }; debug_tile_phase.clear(); } diff --git a/maplibre/src/debug/queue_system.rs b/maplibre/src/debug/queue_system.rs index 5890565b4..826f2e402 100644 --- a/maplibre/src/debug/queue_system.rs +++ b/maplibre/src/debug/queue_system.rs @@ -10,13 +10,12 @@ use crate::{ }; pub fn queue_system(MapContext { world, .. }: &mut MapContext) { - let Some(( - Initialized(tile_view_pattern), - tile_debug_phase, - )) = world.resources.query_mut::<( + let Some((Initialized(tile_view_pattern), tile_debug_phase)) = world.resources.query_mut::<( &mut Eventually, &mut RenderPhase, - )>() else { return; }; + )>() else { + return; + }; for view_tile in tile_view_pattern.iter() { let coords = &view_tile.coords(); diff --git a/maplibre/src/debug/render_commands.rs b/maplibre/src/debug/render_commands.rs index 2376abb1c..7b65072e5 100644 --- a/maplibre/src/debug/render_commands.rs +++ b/maplibre/src/debug/render_commands.rs @@ -18,9 +18,9 @@ impl RenderCommand

for SetDebugPipeline { _item: &P, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult { - let Some(Initialized(pipeline)) = world - .resources - .get::>() else { return RenderCommandResult::Failure; }; + let Some(Initialized(pipeline)) = world.resources.get::>() else { + return RenderCommandResult::Failure; + }; pass.set_render_pipeline(pipeline); RenderCommandResult::Success @@ -34,9 +34,11 @@ impl RenderCommand for DrawDebugOutline { item: &TileDebugItem, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult { - let Some(Initialized(tile_view_pattern)) = world - .resources - .get::>() else { return RenderCommandResult::Failure; }; + let Some(Initialized(tile_view_pattern)) = + world.resources.get::>() + else { + return RenderCommandResult::Failure; + }; let source_shape = &item.source_shape; diff --git a/maplibre/src/debug/resource_system.rs b/maplibre/src/debug/resource_system.rs index 65a864f30..2de8f89af 100644 --- a/maplibre/src/debug/resource_system.rs +++ b/maplibre/src/debug/resource_system.rs @@ -24,11 +24,12 @@ pub fn resource_system( .. }: &mut MapContext, ) { - let Some( - debug_pipeline - ) = world.resources.query_mut::< - &mut Eventually, - >() else { return; }; + let Some(debug_pipeline) = world + .resources + .query_mut::<&mut Eventually>() + else { + return; + }; debug_pipeline.initialize(|| { let mask_shader = shaders::TileMaskShader { diff --git a/maplibre/src/raster/populate_world_system.rs b/maplibre/src/raster/populate_world_system.rs index b742c76a9..fb3533bdf 100644 --- a/maplibre/src/raster/populate_world_system.rs +++ b/maplibre/src/raster/populate_world_system.rs @@ -40,8 +40,11 @@ impl System for PopulateWorldSystem(); let Some(component) = world - .tiles - .query_mut::<&mut RasterLayersDataComponent>(message.coords()) else { continue; }; + .tiles + .query_mut::<&mut RasterLayersDataComponent>(message.coords()) + else { + continue; + }; component .layers @@ -50,7 +53,10 @@ impl System for PopulateWorldSystem(); let Some(component) = world .tiles - .query_mut::<&mut RasterLayersDataComponent>(message.coords()) else { continue; }; + .query_mut::<&mut RasterLayersDataComponent>(message.coords()) + else { + continue; + }; component .layers diff --git a/maplibre/src/raster/queue_system.rs b/maplibre/src/raster/queue_system.rs index 85763583b..ec3425aeb 100644 --- a/maplibre/src/raster/queue_system.rs +++ b/maplibre/src/raster/queue_system.rs @@ -13,11 +13,12 @@ use crate::{ }; pub fn queue_system(MapContext { world, .. }: &mut MapContext) { - let Some(( - Initialized(tile_view_pattern), - )) = world.resources.query::<( - &Eventually, - )>() else { return; }; + let Some((Initialized(tile_view_pattern),)) = world + .resources + .query::<(&Eventually,)>() + else { + return; + }; let mut items = Vec::new(); @@ -49,7 +50,10 @@ pub fn queue_system(MapContext { world, .. }: &mut MapContext) { let Some((layer_item_phase, tile_mask_phase)) = world .resources - .query_mut::<(&mut RenderPhase, &mut RenderPhase,)>() else { return; }; + .query_mut::<(&mut RenderPhase, &mut RenderPhase)>() + else { + return; + }; for (layer, mask) in items { layer_item_phase.add(layer); diff --git a/maplibre/src/raster/render_commands.rs b/maplibre/src/raster/render_commands.rs index 11550d700..0cc61ca58 100644 --- a/maplibre/src/raster/render_commands.rs +++ b/maplibre/src/raster/render_commands.rs @@ -16,9 +16,11 @@ impl RenderCommand

for SetRasterTilePipeline { _item: &P, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult { - let Some(Initialized(raster_resources)) = world - .resources - .get::>() else { return RenderCommandResult::Failure; }; + let Some(Initialized(raster_resources)) = + world.resources.get::>() + else { + return RenderCommandResult::Failure; + }; pass.set_render_pipeline(raster_resources.pipeline()); RenderCommandResult::Success @@ -32,12 +34,15 @@ impl RenderCommand for SetRasterViewBindGroup { item: &LayerItem, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult { - let Some(Initialized(raster_resources)) = world - .resources - .get::>() else { return RenderCommandResult::Failure; }; + let Some(Initialized(raster_resources)) = + world.resources.get::>() + else { + return RenderCommandResult::Failure; + }; - let Some(bind_group) = raster_resources - .get_bound_texture(&item.tile.coords) else { return RenderCommandResult::Failure; }; + let Some(bind_group) = raster_resources.get_bound_texture(&item.tile.coords) else { + return RenderCommandResult::Failure; + }; pass.set_bind_group(0, bind_group, &[]); RenderCommandResult::Success @@ -51,9 +56,11 @@ impl RenderCommand for DrawRasterTile { item: &LayerItem, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult { - let Some(Initialized(tile_view_pattern)) = world - .resources - .get::>() else { return RenderCommandResult::Failure; }; + let Some(Initialized(tile_view_pattern)) = + world.resources.get::>() + else { + return RenderCommandResult::Failure; + }; let source_shape = &item.source_shape; diff --git a/maplibre/src/raster/request_system.rs b/maplibre/src/raster/request_system.rs index 29721bdcc..e5a242597 100644 --- a/maplibre/src/raster/request_system.rs +++ b/maplibre/src/raster/request_system.rs @@ -110,8 +110,8 @@ pub fn fetch_raster_apc< kernel: K, ) -> AsyncProcedureFuture { Box::pin(async move { - let Input::TileRequest {coords, style} = input else { - return Err(ProcedureError::IncompatibleInput) + let Input::TileRequest { coords, style } = input else { + return Err(ProcedureError::IncompatibleInput); }; let raster_layers: HashSet = style diff --git a/maplibre/src/raster/resource_system.rs b/maplibre/src/raster/resource_system.rs index 56fa0ab06..6797ffba6 100644 --- a/maplibre/src/raster/resource_system.rs +++ b/maplibre/src/raster/resource_system.rs @@ -27,7 +27,10 @@ pub fn resource_system( ) { let Some(raster_resources) = world .resources - .query_mut::<&mut Eventually>() else { return; }; + .query_mut::<&mut Eventually>() + else { + return; + }; raster_resources.initialize(|| { let shader = shaders::RasterTileShader { diff --git a/maplibre/src/raster/upload_system.rs b/maplibre/src/raster/upload_system.rs index 0d5265a3b..d6f57086b 100644 --- a/maplibre/src/raster/upload_system.rs +++ b/maplibre/src/raster/upload_system.rs @@ -25,7 +25,10 @@ pub fn upload_system( ) { let Some(Initialized(raster_resources)) = world .resources - .query_mut::<&mut Eventually>() else { return; }; + .query_mut::<&mut Eventually>() + else { + return; + }; let view_region = view_state.create_view_region(); if let Some(view_region) = &view_region { @@ -54,23 +57,24 @@ fn upload_raster_layer( continue; } - let Some(raster_layers) = - tiles.query::<&RasterLayersDataComponent>(coords) else { continue; }; + let Some(raster_layers) = tiles.query::<&RasterLayersDataComponent>(coords) else { + continue; + }; for style_layer in &style.layers { let style_source_layer = style_layer.source_layer.as_ref().unwrap(); // FIXME: Remove unwrap - let Some(AvailableRasterLayerData { - coords, - image, - .. - }) = raster_layers.layers + let Some(AvailableRasterLayerData { coords, image, .. }) = raster_layers + .layers .iter() .flat_map(|data| match data { RasterLayerData::Available(data) => Some(data), RasterLayerData::Missing(_) => None, }) - .find(|layer| style_source_layer.as_str() == layer.source_layer) else { continue; }; + .find(|layer| style_source_layer.as_str() == layer.source_layer) + else { + continue; + }; let (width, height) = image.dimensions(); diff --git a/maplibre/src/render/mod.rs b/maplibre/src/render/mod.rs index 9e15e151d..f75b76c47 100644 --- a/maplibre/src/render/mod.rs +++ b/maplibre/src/render/mod.rs @@ -465,7 +465,7 @@ mod tests { backends, dx12_shader_compiler: Default::default(), }); - let adapter = wgpu::util::initialize_adapter_from_env_or_default(&instance, backends, None) + let adapter = wgpu::util::initialize_adapter_from_env_or_default(&instance, None) .await .expect("Unable to initialize adapter"); diff --git a/maplibre/src/render/render_commands.rs b/maplibre/src/render/render_commands.rs index 4f9d543c3..87cda1f49 100644 --- a/maplibre/src/render/render_commands.rs +++ b/maplibre/src/render/render_commands.rs @@ -18,7 +18,9 @@ impl RenderCommand

for SetMaskPipeline { _item: &P, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult { - let Some(Initialized(pipeline)) = world.resources.get::>() else { return RenderCommandResult::Failure; }; + let Some(Initialized(pipeline)) = world.resources.get::>() else { + return RenderCommandResult::Failure; + }; pass.set_render_pipeline(pipeline); RenderCommandResult::Success } @@ -31,9 +33,11 @@ impl RenderCommand for DrawMask { item: &TileMaskItem, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult { - let Some(Initialized(tile_view_pattern)) = world - .resources - .get::>() else { return RenderCommandResult::Failure; }; + let Some(Initialized(tile_view_pattern)) = + world.resources.get::>() + else { + return RenderCommandResult::Failure; + }; let tile_mask = &item.source_shape; diff --git a/maplibre/src/render/systems/cleanup_system.rs b/maplibre/src/render/systems/cleanup_system.rs index cd7a6edcd..4d01f53c0 100644 --- a/maplibre/src/render/systems/cleanup_system.rs +++ b/maplibre/src/render/systems/cleanup_system.rs @@ -6,10 +6,10 @@ use crate::{ pub fn cleanup_system(MapContext { world, .. }: &mut MapContext) { let Some((layer_item_phase, tile_mask_phase)) = world .resources - .query_mut::<( - &mut RenderPhase, - &mut RenderPhase, - )>() else { return; }; + .query_mut::<(&mut RenderPhase, &mut RenderPhase)>() + else { + return; + }; layer_item_phase.clear(); tile_mask_phase.clear(); diff --git a/maplibre/src/render/systems/resource_system.rs b/maplibre/src/render/systems/resource_system.rs index 4f596c4ca..11bdee63b 100644 --- a/maplibre/src/render/systems/resource_system.rs +++ b/maplibre/src/render/systems/resource_system.rs @@ -38,13 +38,12 @@ impl System for ResourceSystem { .. }: &mut MapContext, ) { - let Some(( - tile_view_pattern, - mask_pipeline - )) = world.resources.query_mut::<( + let Some((tile_view_pattern, mask_pipeline)) = world.resources.query_mut::<( &mut Eventually, &mut Eventually, - )>() else { return; }; + )>() else { + return; + }; let surface = &mut state.surface; diff --git a/maplibre/src/render/systems/tile_view_pattern_system.rs b/maplibre/src/render/systems/tile_view_pattern_system.rs index a501c84c4..5f847750c 100644 --- a/maplibre/src/render/systems/tile_view_pattern_system.rs +++ b/maplibre/src/render/systems/tile_view_pattern_system.rs @@ -13,13 +13,12 @@ pub fn tile_view_pattern_system( view_state, world, .. }: &mut MapContext, ) { - let Some(( - Initialized(tile_view_pattern), - view_tile_sources, - )) = world.resources.query::<( - &Eventually, - &ViewTileSources - )>() else { return; }; + let Some((Initialized(tile_view_pattern), view_tile_sources)) = world + .resources + .query::<(&Eventually, &ViewTileSources)>() + else { + return; + }; let view_region = view_state.create_view_region(); if let Some(view_region) = &view_region { @@ -31,7 +30,10 @@ pub fn tile_view_pattern_system( // TODO: Can we &mut borrow initially somehow instead of here? let Some(Initialized(tile_view_pattern)) = world .resources - .query_mut::<&mut Eventually>() else { return; }; + .query_mut::<&mut Eventually>() + else { + return; + }; tile_view_pattern.update_pattern(view_tiles); } diff --git a/maplibre/src/render/systems/upload_system.rs b/maplibre/src/render/systems/upload_system.rs index 85155280e..8ee54d9b7 100644 --- a/maplibre/src/render/systems/upload_system.rs +++ b/maplibre/src/render/systems/upload_system.rs @@ -16,11 +16,12 @@ pub fn upload_system( .. }: &mut MapContext, ) { - let Some( - Initialized(tile_view_pattern) - ) = world.resources.query_mut::< - &mut Eventually - >() else { return; }; + let Some(Initialized(tile_view_pattern)) = world + .resources + .query_mut::<&mut Eventually>() + else { + return; + }; let view_proj = view_state.view_projection(); tile_view_pattern.upload_pattern(queue, &view_proj); diff --git a/maplibre/src/vector/mod.rs b/maplibre/src/vector/mod.rs index 0d6812675..71d807dff 100644 --- a/maplibre/src/vector/mod.rs +++ b/maplibre/src/vector/mod.rs @@ -71,9 +71,10 @@ struct VectorTilesDone; impl HasTile for VectorTilesDone { fn has_tile(&self, coords: WorldTileCoords, world: &World) -> bool { - let Some(vector_layers_indices) = world - .tiles - .query::<&VectorLayersDataComponent>(coords) else { return false; }; + let Some(vector_layers_indices) = world.tiles.query::<&VectorLayersDataComponent>(coords) + else { + return false; + }; vector_layers_indices.done } diff --git a/maplibre/src/vector/populate_world_system.rs b/maplibre/src/vector/populate_world_system.rs index b9ed96e7e..29a1d569a 100644 --- a/maplibre/src/vector/populate_world_system.rs +++ b/maplibre/src/vector/populate_world_system.rs @@ -39,15 +39,21 @@ impl System for PopulateWorldSystem(); let Some(component) = world - .tiles - .query_mut::<&mut VectorLayersDataComponent>(message.coords()) else { continue; }; + .tiles + .query_mut::<&mut VectorLayersDataComponent>(message.coords()) + else { + continue; + }; component.done = true; } else if message.has_tag(T::LayerMissing::message_tag()) { let message = message.into_transferable::(); let Some(component) = world - .tiles - .query_mut::<&mut VectorLayersDataComponent>(message.coords()) else { continue; }; + .tiles + .query_mut::<&mut VectorLayersDataComponent>(message.coords()) + else { + continue; + }; component .layers @@ -60,8 +66,11 @@ impl System for PopulateWorldSystem(message.coords()) else { continue; }; + .tiles + .query_mut::<&mut VectorLayersDataComponent>(message.coords()) + else { + continue; + }; component .layers diff --git a/maplibre/src/vector/queue_system.rs b/maplibre/src/vector/queue_system.rs index d45eacb74..adfc5a308 100644 --- a/maplibre/src/vector/queue_system.rs +++ b/maplibre/src/vector/queue_system.rs @@ -16,13 +16,16 @@ pub fn queue_system(MapContext { world, .. }: &mut MapContext) { Initialized(tile_view_pattern), Initialized(buffer_pool), mask_phase, - layer_item_phase + layer_item_phase, )) = world.resources.query_mut::<( &mut Eventually, &mut Eventually, &mut RenderPhase, &mut RenderPhase, - )>() else { return; }; + )>() + else { + return; + }; let buffer_pool_index = buffer_pool.index(); diff --git a/maplibre/src/vector/render_commands.rs b/maplibre/src/vector/render_commands.rs index 45bd757c0..9a6166727 100644 --- a/maplibre/src/vector/render_commands.rs +++ b/maplibre/src/vector/render_commands.rs @@ -19,9 +19,10 @@ impl RenderCommand

for SetVectorTilePipeline { _item: &P, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult { - let Some(Initialized(pipeline)) = world - .resources - .get::>() else { return RenderCommandResult::Failure; }; + let Some(Initialized(pipeline)) = world.resources.get::>() + else { + return RenderCommandResult::Failure; + }; pass.set_render_pipeline(pipeline); RenderCommandResult::Success @@ -35,19 +36,25 @@ impl RenderCommand for DrawVectorTile { item: &LayerItem, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult { - let Some(( - Initialized(buffer_pool), - Initialized(tile_view_pattern), - )) = world.resources.query::<( - &Eventually, - &Eventually - )>() else { return RenderCommandResult::Failure; }; + let Some((Initialized(buffer_pool), Initialized(tile_view_pattern))) = + world.resources.query::<( + &Eventually, + &Eventually, + )>() + else { + return RenderCommandResult::Failure; + }; - let Some(vector_layers) = buffer_pool.index().get_layers(item.tile.coords) else { return RenderCommandResult::Failure; }; + let Some(vector_layers) = buffer_pool.index().get_layers(item.tile.coords) else { + return RenderCommandResult::Failure; + }; let Some(entry) = vector_layers .iter() - .find(|entry| entry.style_layer.id == item.style_layer) else { return RenderCommandResult::Failure; }; + .find(|entry| entry.style_layer.id == item.style_layer) + else { + return RenderCommandResult::Failure; + }; let source_shape = &item.source_shape; diff --git a/maplibre/src/vector/request_system.rs b/maplibre/src/vector/request_system.rs index 7dd1c0837..bb793161a 100644 --- a/maplibre/src/vector/request_system.rs +++ b/maplibre/src/vector/request_system.rs @@ -111,8 +111,8 @@ pub fn fetch_vector_apc< kernel: K, ) -> AsyncProcedureFuture { Box::pin(async move { - let Input::TileRequest {coords, style} = input else { - return Err(ProcedureError::IncompatibleInput) + let Input::TileRequest { coords, style } = input else { + return Err(ProcedureError::IncompatibleInput); }; let fill_layers: HashSet = style diff --git a/maplibre/src/vector/resource_system.rs b/maplibre/src/vector/resource_system.rs index 23335b6d9..efc4c579e 100644 --- a/maplibre/src/vector/resource_system.rs +++ b/maplibre/src/vector/resource_system.rs @@ -24,13 +24,12 @@ pub fn resource_system( .. }: &mut MapContext, ) { - let Some(( - buffer_pool, - vector_pipeline - )) = world.resources.query_mut::<( + let Some((buffer_pool, vector_pipeline)) = world.resources.query_mut::<( &mut Eventually, - &mut Eventually - )>() else { return; }; + &mut Eventually, + )>() else { + return; + }; buffer_pool.initialize(|| BufferPool::from_device(device)); diff --git a/maplibre/src/vector/upload_system.rs b/maplibre/src/vector/upload_system.rs index 98323fc80..1df0cc51c 100644 --- a/maplibre/src/vector/upload_system.rs +++ b/maplibre/src/vector/upload_system.rs @@ -26,11 +26,12 @@ pub fn upload_system( .. }: &mut MapContext, ) { - let Some( - Initialized(buffer_pool) - ) = world.resources.query_mut::< - &mut Eventually, - >() else { return; }; + let Some(Initialized(buffer_pool)) = world + .resources + .query_mut::<&mut Eventually>() + else { + return; + }; let view_region = view_state.create_view_region(); @@ -128,7 +129,9 @@ fn upload_tesselated_layer( ) { // Upload all tessellated layers which are in view for coords in view_region.iter() { - let Some(vector_layers) = tiles.query_mut::<&VectorLayersDataComponent>(coords) else { continue; }; + let Some(vector_layers) = tiles.query_mut::<&VectorLayersDataComponent>(coords) else { + continue; + }; let loaded_layers = buffer_pool .get_loaded_source_layers_at(coords) @@ -148,13 +151,16 @@ fn upload_tesselated_layer( let source_layer = style_layer.source_layer.as_ref().unwrap(); // TODO: Unwrap let Some(AvailableVectorLayerData { - coords, - feature_indices, - buffer, - .. - }) = available_layers + coords, + feature_indices, + buffer, + .. + }) = available_layers .iter() - .find(|layer| source_layer.as_str() == layer.source_layer) else { continue; }; + .find(|layer| source_layer.as_str() == layer.source_layer) + else { + continue; + }; let color: Option = style_layer .paint diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 37cdfab08..6b3d02509 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -3,4 +3,6 @@ # The CI might use it though to build other Rust binaries, required for building maplibre-rs. # This file is here to give IDEs a hint about which Rust version to use. # The version is set here instead of using stable, so we can make sure that a predictable version is used. -channel = "1.68" +# +# Keep this in sync with `justfile` and `Cargo.toml` +channel = "1.72.1" diff --git a/web/Cargo.toml b/web/Cargo.toml index 88e16ca28..4f20f8be4 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -9,6 +9,7 @@ edition.workspace = true rust-version.workspace = true license.workspace = true keywords.workspace = true +categories.workspace = true authors.workspace = true [features] diff --git a/web/src/error.rs b/web/src/error.rs index c8a014c25..f9a3f39fd 100644 --- a/web/src/error.rs +++ b/web/src/error.rs @@ -28,15 +28,15 @@ pub enum WebError { impl From for WebError { fn from(value: JsValue) -> Self { if let Some(error) = value.dyn_ref::() { - let Some(message) = error - .message() - .as_string() else { return WebError::InvalidMessage; }; + let Some(message) = error.message().as_string() else { + return WebError::InvalidMessage; + }; WebError::TypeError(message.into()) } else if let Some(error) = value.dyn_ref::() { - let Some(message) = error - .message() - .as_string() else { return WebError::InvalidMessage; }; + let Some(message) = error.message().as_string() else { + return WebError::InvalidMessage; + }; WebError::GenericError(message.into()) } else {