diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 16ad9a6..71cbab0 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.94.0" +channel = "1.95.0" profile = "minimal" diff --git a/src/bin/mapcat/sender.rs b/src/bin/mapcat/sender.rs index 286cc1f..1da6b10 100644 --- a/src/bin/mapcat/sender.rs +++ b/src/bin/mapcat/sender.rs @@ -145,7 +145,7 @@ impl MapSender { return false; } - while let Err(e) = surf::get(format!("http://localhost:{DEFAULT_PORT}/healthcheck",)) + while let Err(e) = surf::get(format!("http://localhost:{DEFAULT_PORT}/healthcheck")) .send() .await { diff --git a/src/map/mapvas_egui/layer/shape_layer.rs b/src/map/mapvas_egui/layer/shape_layer.rs index fe90fc2..f494ab3 100644 --- a/src/map/mapvas_egui/layer/shape_layer.rs +++ b/src/map/mapvas_egui/layer/shape_layer.rs @@ -382,7 +382,7 @@ impl ShapeLayer { received = true; let l = self.shape_map.entry(id.clone()).or_default(); let start_idx = l.len(); - l.extend(geometries.into_iter()); + l.extend(geometries); self.layer_visibility.entry(id.clone()).or_insert(true); for i in start_idx..l.len() { @@ -2675,14 +2675,12 @@ impl ShapeLayer { for &path_index in nested_path { match current_geometry { - Geometry::GeometryCollection(nested_geometries, _) => { - if path_index < nested_geometries.len() { - current_geometry = &nested_geometries[path_index]; - } else { - return None; // Invalid path index - } + Geometry::GeometryCollection(nested_geometries, _) + if path_index < nested_geometries.len() => + { + current_geometry = &nested_geometries[path_index]; } - _ => return None, // Path continues but current geometry is not a collection + _ => return None, } } diff --git a/src/map/mapvas_egui/layer/tile_layer.rs b/src/map/mapvas_egui/layer/tile_layer.rs index 7c2af41..9d7e3f1 100644 --- a/src/map/mapvas_egui/layer/tile_layer.rs +++ b/src/map/mapvas_egui/layer/tile_layer.rs @@ -419,7 +419,7 @@ impl TileLayer { }); let render_result = - tokio::time::timeout(std::time::Duration::from_secs(60), render_rx).await; + tokio::time::timeout(std::time::Duration::from_mins(1), render_rx).await; let render_duration = render_start.elapsed(); diff --git a/src/mapvas_ui.rs b/src/mapvas_ui.rs index 475010e..840eeaa 100644 --- a/src/mapvas_ui.rs +++ b/src/mapvas_ui.rs @@ -802,7 +802,7 @@ impl Sidebar { for category in category_order { if let Some(mut tasks) = tasks_by_category.remove(&category) { // Sort by elapsed time (newest first) - tasks.sort_by_key(|(_, task)| std::cmp::Reverse(task.elapsed())); + tasks.sort_by_cached_key(|(_, task)| std::cmp::Reverse(task.elapsed())); let category_name = match category { TaskCategory::TileLoad => "🗺 Tile Loading", diff --git a/src/parser/geojson.rs b/src/parser/geojson.rs index d06239e..36cb732 100644 --- a/src/parser/geojson.rs +++ b/src/parser/geojson.rs @@ -760,23 +760,21 @@ mod tests { for geometry in &layer.geometries { match geometry { - Geometry::Point(_, metadata) => { + Geometry::Point(_, metadata) if metadata .time_data .as_ref() - .is_some_and(|td| td.timestamp.is_some()) - { - features_with_timestamps += 1; - } + .is_some_and(|td| td.timestamp.is_some()) => + { + features_with_timestamps += 1; } - Geometry::LineString(_, metadata) => { + Geometry::LineString(_, metadata) if metadata .time_data .as_ref() - .is_some_and(|td| td.time_span.is_some()) - { - features_with_time_spans += 1; - } + .is_some_and(|td| td.time_span.is_some()) => + { + features_with_time_spans += 1; } _ => {} } diff --git a/src/parser/gpx.rs b/src/parser/gpx.rs index 4e6054f..e0c6250 100644 --- a/src/parser/gpx.rs +++ b/src/parser/gpx.rs @@ -340,19 +340,16 @@ mod tests { for geometry in &layer.geometries { match geometry { - Geometry::Point(_, metadata) => { - if metadata.time_data.is_some() { - timestamped_points += 1; - } + Geometry::Point(_, metadata) if metadata.time_data.is_some() => { + timestamped_points += 1; } - Geometry::LineString(_, metadata) => { + Geometry::LineString(_, metadata) if metadata .time_data .as_ref() - .is_some_and(|td| td.time_span.is_some()) - { - linestrings_with_timespan += 1; - } + .is_some_and(|td| td.time_span.is_some()) => + { + linestrings_with_timespan += 1; } _ => {} } diff --git a/src/remote.rs b/src/remote.rs index 478cf1c..a166c52 100644 --- a/src/remote.rs +++ b/src/remote.rs @@ -144,7 +144,7 @@ pub async fn remote_runner(remote: Remote) { // Keep it running. loop { - tokio::time::sleep(tokio::time::Duration::from_secs(3600)).await; + tokio::time::sleep(tokio::time::Duration::from_hours(1)).await; } } diff --git a/src/search.rs b/src/search.rs index 8fa15f3..2c04fe2 100644 --- a/src/search.rs +++ b/src/search.rs @@ -172,11 +172,7 @@ impl SearchManager { } // Sort by relevance (highest first) - all_results.sort_by(|a, b| { - b.relevance - .partial_cmp(&a.relevance) - .unwrap_or(std::cmp::Ordering::Equal) - }); + all_results.sort_by(|a, b| b.relevance.total_cmp(&a.relevance)); // Limit total results all_results.truncate(10); diff --git a/tests/grid_snapshot_tests.rs b/tests/grid_snapshot_tests.rs index fc9ebcd..60dbffc 100644 --- a/tests/grid_snapshot_tests.rs +++ b/tests/grid_snapshot_tests.rs @@ -11,7 +11,7 @@ use std::fs; use std::io::Cursor; fn create_test_app_with_geojson_grid_mode(geojson_content: String) -> MapApp { - let config = Config::new(); + let config = Config::default(); let ctx = egui::Context::default(); let (mut map, remote, data_holder) = Map::new(ctx); map.set_headless(); @@ -33,7 +33,7 @@ fn create_test_app_with_geojson_grid_mode(geojson_content: String) -> MapApp { } fn create_test_app_grid_mode() -> MapApp { - let config = Config::new(); + let config = Config::default(); let ctx = egui::Context::default(); let (mut map, remote, data_holder) = Map::new(ctx); map.set_headless(); diff --git a/tests/highlight_snapshot_tests.rs b/tests/highlight_snapshot_tests.rs index 2f80b53..9ea7c99 100644 --- a/tests/highlight_snapshot_tests.rs +++ b/tests/highlight_snapshot_tests.rs @@ -11,7 +11,7 @@ use std::fs; use std::io::Cursor; fn create_test_app_with_geometries() -> MapApp { - let config = Config::new(); + let config = Config::default(); let ctx = egui::Context::default(); let (mut map, remote, data_holder) = Map::new(ctx); map.set_headless(); diff --git a/tests/popup_double_click_tests.rs b/tests/popup_double_click_tests.rs index 659c6cd..3958abe 100644 --- a/tests/popup_double_click_tests.rs +++ b/tests/popup_double_click_tests.rs @@ -10,7 +10,7 @@ use mapvas::{ use std::io::Cursor; fn create_test_app_with_nested_kml() -> MapApp { - let config = Config::new(); + let config = Config::default(); let ctx = egui::Context::default(); let (mut map, remote, data_holder) = Map::new(ctx); map.set_headless(); diff --git a/tests/popup_snapshot_tests.rs b/tests/popup_snapshot_tests.rs index d3e9a75..b532d66 100644 --- a/tests/popup_snapshot_tests.rs +++ b/tests/popup_snapshot_tests.rs @@ -11,7 +11,7 @@ use std::fs; use std::io::Cursor; fn create_test_app_with_popup_kml() -> MapApp { - let config = Config::new(); + let config = Config::default(); let ctx = egui::Context::default(); let (mut map, remote, data_holder) = Map::new(ctx); map.set_headless(); diff --git a/tests/snapshots/coordinates_grid_only_mode.png b/tests/snapshots/coordinates_grid_only_mode.png index 38918cd..7734e3e 100644 Binary files a/tests/snapshots/coordinates_grid_only_mode.png and b/tests/snapshots/coordinates_grid_only_mode.png differ diff --git a/tests/snapshots/coordinates_off_mode.png b/tests/snapshots/coordinates_off_mode.png index 96e9aec..cb002e6 100644 Binary files a/tests/snapshots/coordinates_off_mode.png and b/tests/snapshots/coordinates_off_mode.png differ diff --git a/tests/snapshots/debug_range_timeline_fixed.png b/tests/snapshots/debug_range_timeline_fixed.png index b6c9237..453bae6 100644 Binary files a/tests/snapshots/debug_range_timeline_fixed.png and b/tests/snapshots/debug_range_timeline_fixed.png differ diff --git a/tests/snapshots/empty_grid_mode.png b/tests/snapshots/empty_grid_mode.png index 91fffe4..c2cc111 100644 Binary files a/tests/snapshots/empty_grid_mode.png and b/tests/snapshots/empty_grid_mode.png differ diff --git a/tests/snapshots/empty_grid_mode_clean.png b/tests/snapshots/empty_grid_mode_clean.png index e8aedc7..8da5262 100644 Binary files a/tests/snapshots/empty_grid_mode_clean.png and b/tests/snapshots/empty_grid_mode_clean.png differ diff --git a/tests/snapshots/geojson_grid_clean_view.png b/tests/snapshots/geojson_grid_clean_view.png index 6cb3c99..32859f5 100644 Binary files a/tests/snapshots/geojson_grid_clean_view.png and b/tests/snapshots/geojson_grid_clean_view.png differ diff --git a/tests/snapshots/geojson_on_grid_mode.png b/tests/snapshots/geojson_on_grid_mode.png index cda47af..96a8037 100644 Binary files a/tests/snapshots/geojson_on_grid_mode.png and b/tests/snapshots/geojson_on_grid_mode.png differ diff --git a/tests/snapshots/geometry_shapes_expanded.png b/tests/snapshots/geometry_shapes_expanded.png index 719187f..0a8380a 100644 Binary files a/tests/snapshots/geometry_shapes_expanded.png and b/tests/snapshots/geometry_shapes_expanded.png differ diff --git a/tests/snapshots/geometry_ui_ready_for_interaction.png b/tests/snapshots/geometry_ui_ready_for_interaction.png index 719187f..0a8380a 100644 Binary files a/tests/snapshots/geometry_ui_ready_for_interaction.png and b/tests/snapshots/geometry_ui_ready_for_interaction.png differ diff --git a/tests/snapshots/grid_mode_sidebar_collapsed.png b/tests/snapshots/grid_mode_sidebar_collapsed.png index e8aedc7..8da5262 100644 Binary files a/tests/snapshots/grid_mode_sidebar_collapsed.png and b/tests/snapshots/grid_mode_sidebar_collapsed.png differ diff --git a/tests/snapshots/grid_mode_sidebar_full.png b/tests/snapshots/grid_mode_sidebar_full.png index 91fffe4..c2cc111 100644 Binary files a/tests/snapshots/grid_mode_sidebar_full.png and b/tests/snapshots/grid_mode_sidebar_full.png differ diff --git a/tests/snapshots/grid_only_mode_basic.png b/tests/snapshots/grid_only_mode_basic.png index 91fffe4..c2cc111 100644 Binary files a/tests/snapshots/grid_only_mode_basic.png and b/tests/snapshots/grid_only_mode_basic.png differ diff --git a/tests/snapshots/large_file_temporal_range.png b/tests/snapshots/large_file_temporal_range.png index f93f754..9d670b8 100644 Binary files a/tests/snapshots/large_file_temporal_range.png and b/tests/snapshots/large_file_temporal_range.png differ diff --git a/tests/snapshots/popup_functionality_test.png b/tests/snapshots/popup_functionality_test.png index b50c3d5..9ccb65f 100644 Binary files a/tests/snapshots/popup_functionality_test.png and b/tests/snapshots/popup_functionality_test.png differ diff --git a/tests/snapshots/popup_initial_sidebar.png b/tests/snapshots/popup_initial_sidebar.png index 4ba9392..55f658a 100644 Binary files a/tests/snapshots/popup_initial_sidebar.png and b/tests/snapshots/popup_initial_sidebar.png differ diff --git a/tests/snapshots/popup_memory_management_stable.png b/tests/snapshots/popup_memory_management_stable.png index b50c3d5..9ccb65f 100644 Binary files a/tests/snapshots/popup_memory_management_stable.png and b/tests/snapshots/popup_memory_management_stable.png differ diff --git a/tests/snapshots/popup_nested_expanded.png b/tests/snapshots/popup_nested_expanded.png index fb87d98..288401f 100644 Binary files a/tests/snapshots/popup_nested_expanded.png and b/tests/snapshots/popup_nested_expanded.png differ diff --git a/tests/snapshots/popup_nested_initial.png b/tests/snapshots/popup_nested_initial.png index b50c3d5..9ccb65f 100644 Binary files a/tests/snapshots/popup_nested_initial.png and b/tests/snapshots/popup_nested_initial.png differ diff --git a/tests/snapshots/popup_nested_ready_for_interaction.png b/tests/snapshots/popup_nested_ready_for_interaction.png index fb87d98..288401f 100644 Binary files a/tests/snapshots/popup_nested_ready_for_interaction.png and b/tests/snapshots/popup_nested_ready_for_interaction.png differ diff --git a/tests/snapshots/popup_shape_layer_expanded.png b/tests/snapshots/popup_shape_layer_expanded.png index 4b04901..c79a12e 100644 Binary files a/tests/snapshots/popup_shape_layer_expanded.png and b/tests/snapshots/popup_shape_layer_expanded.png differ diff --git a/tests/snapshots/popup_shapes_visible.png b/tests/snapshots/popup_shapes_visible.png index fb87d98..288401f 100644 Binary files a/tests/snapshots/popup_shapes_visible.png and b/tests/snapshots/popup_shapes_visible.png differ diff --git a/tests/snapshots/popup_sidebar_with_collections.png b/tests/snapshots/popup_sidebar_with_collections.png index 4ba9392..55f658a 100644 Binary files a/tests/snapshots/popup_sidebar_with_collections.png and b/tests/snapshots/popup_sidebar_with_collections.png differ diff --git a/tests/snapshots/temporal_filtering_09_00_only_morning_visible.png b/tests/snapshots/temporal_filtering_09_00_only_morning_visible.png index b6c9237..453bae6 100644 Binary files a/tests/snapshots/temporal_filtering_09_00_only_morning_visible.png and b/tests/snapshots/temporal_filtering_09_00_only_morning_visible.png differ diff --git a/tests/snapshots/temporal_filtering_after_animation_started.png b/tests/snapshots/temporal_filtering_after_animation_started.png index b6c9237..453bae6 100644 Binary files a/tests/snapshots/temporal_filtering_after_animation_started.png and b/tests/snapshots/temporal_filtering_after_animation_started.png differ diff --git a/tests/snapshots/temporal_filtering_after_controls_visible.png b/tests/snapshots/temporal_filtering_after_controls_visible.png index b6c9237..453bae6 100644 Binary files a/tests/snapshots/temporal_filtering_after_controls_visible.png and b/tests/snapshots/temporal_filtering_after_controls_visible.png differ diff --git a/tests/snapshots/temporal_initial_state.png b/tests/snapshots/temporal_initial_state.png index b6c9237..453bae6 100644 Binary files a/tests/snapshots/temporal_initial_state.png and b/tests/snapshots/temporal_initial_state.png differ diff --git a/tests/snapshots/temporal_morning_state.png b/tests/snapshots/temporal_morning_state.png index b6c9237..453bae6 100644 Binary files a/tests/snapshots/temporal_morning_state.png and b/tests/snapshots/temporal_morning_state.png differ diff --git a/tests/snapshots/temporal_timeline_expanded.png b/tests/snapshots/temporal_timeline_expanded.png index b6c9237..453bae6 100644 Binary files a/tests/snapshots/temporal_timeline_expanded.png and b/tests/snapshots/temporal_timeline_expanded.png differ diff --git a/tests/snapshots/temporal_with_geometries.png b/tests/snapshots/temporal_with_geometries.png index b6c9237..453bae6 100644 Binary files a/tests/snapshots/temporal_with_geometries.png and b/tests/snapshots/temporal_with_geometries.png differ diff --git a/tests/snapshots/temporal_workflow_step1_timeline_available.png b/tests/snapshots/temporal_workflow_step1_timeline_available.png index cc2432d..d1ad784 100644 Binary files a/tests/snapshots/temporal_workflow_step1_timeline_available.png and b/tests/snapshots/temporal_workflow_step1_timeline_available.png differ diff --git a/tests/snapshots/temporal_workflow_step2_controls_expanded.png b/tests/snapshots/temporal_workflow_step2_controls_expanded.png index b6c9237..453bae6 100644 Binary files a/tests/snapshots/temporal_workflow_step2_controls_expanded.png and b/tests/snapshots/temporal_workflow_step2_controls_expanded.png differ diff --git a/tests/snapshots/temporal_workflow_step3_temporal_data_loaded.png b/tests/snapshots/temporal_workflow_step3_temporal_data_loaded.png index b6c9237..453bae6 100644 Binary files a/tests/snapshots/temporal_workflow_step3_temporal_data_loaded.png and b/tests/snapshots/temporal_workflow_step3_temporal_data_loaded.png differ diff --git a/tests/snapshots/unix_epoch_first_timestamp.png b/tests/snapshots/unix_epoch_first_timestamp.png index e1e9733..1f4ebed 100644 Binary files a/tests/snapshots/unix_epoch_first_timestamp.png and b/tests/snapshots/unix_epoch_first_timestamp.png differ diff --git a/tests/snapshots/unix_epoch_no_timezone_parsed.png b/tests/snapshots/unix_epoch_no_timezone_parsed.png index e1e9733..1f4ebed 100644 Binary files a/tests/snapshots/unix_epoch_no_timezone_parsed.png and b/tests/snapshots/unix_epoch_no_timezone_parsed.png differ diff --git a/tests/snapshots/unix_epoch_timeline_controls_visible.png b/tests/snapshots/unix_epoch_timeline_controls_visible.png index e1e9733..1f4ebed 100644 Binary files a/tests/snapshots/unix_epoch_timeline_controls_visible.png and b/tests/snapshots/unix_epoch_timeline_controls_visible.png differ diff --git a/tests/snapshots/unix_epoch_timeline_detected.png b/tests/snapshots/unix_epoch_timeline_detected.png index e1e9733..1f4ebed 100644 Binary files a/tests/snapshots/unix_epoch_timeline_detected.png and b/tests/snapshots/unix_epoch_timeline_detected.png differ diff --git a/tests/snapshots/workflow_final_grid_view.png b/tests/snapshots/workflow_final_grid_view.png index f743736..33d609e 100644 Binary files a/tests/snapshots/workflow_final_grid_view.png and b/tests/snapshots/workflow_final_grid_view.png differ diff --git a/tests/snapshots/workflow_grid_mode_active.png b/tests/snapshots/workflow_grid_mode_active.png index 081a997..d236b8d 100644 Binary files a/tests/snapshots/workflow_grid_mode_active.png and b/tests/snapshots/workflow_grid_mode_active.png differ diff --git a/tests/snapshots/workflow_settings_opened.png b/tests/snapshots/workflow_settings_opened.png index 1b59e86..485bcef 100644 Binary files a/tests/snapshots/workflow_settings_opened.png and b/tests/snapshots/workflow_settings_opened.png differ diff --git a/tests/temporal_snapshot_tests.rs b/tests/temporal_snapshot_tests.rs index 2ae7ce7..7bdd637 100644 --- a/tests/temporal_snapshot_tests.rs +++ b/tests/temporal_snapshot_tests.rs @@ -11,7 +11,7 @@ use std::fs; use std::io::Cursor; fn create_test_app_with_temporal_kml() -> MapApp { - let config = Config::new(); + let config = Config::default(); let ctx = egui::Context::default(); let (mut map, remote, data_holder) = Map::new(ctx); map.set_headless(); @@ -36,7 +36,7 @@ fn create_test_app_with_temporal_kml() -> MapApp { } fn create_test_app_with_unix_epoch_kml() -> MapApp { - let config = Config::new(); + let config = Config::default(); let ctx = egui::Context::default(); let (mut map, remote, data_holder) = Map::new(ctx); map.set_headless(); @@ -388,7 +388,7 @@ async fn unix_epoch_temporal_filtering() { } fn create_test_app_with_debug_range_kml() -> MapApp { - let config = Config::new(); + let config = Config::default(); let ctx = egui::Context::default(); let (mut map, remote, data_holder) = Map::new(ctx); map.set_headless(); @@ -413,7 +413,7 @@ fn create_test_app_with_debug_range_kml() -> MapApp { } fn create_test_app_with_unix_epoch_no_tz_kml() -> MapApp { - let config = Config::new(); + let config = Config::default(); let ctx = egui::Context::default(); let (mut map, remote, data_holder) = Map::new(ctx); map.set_headless(); @@ -527,7 +527,7 @@ async fn large_file_temporal_parsing() { "#; - let config = Config::new(); + let config = Config::default(); let ctx = egui::Context::default(); let (mut map, remote, data_holder) = Map::new(ctx); map.set_headless(); diff --git a/tests/ui_tests.rs b/tests/ui_tests.rs index f45b9ef..c881461 100644 --- a/tests/ui_tests.rs +++ b/tests/ui_tests.rs @@ -5,7 +5,7 @@ use egui_kittest::kittest::Queryable; use mapvas::{config::Config, map::mapvas_egui::Map, mapvas_ui::MapApp}; fn create_test_app() -> MapApp { - let config = Config::new(); + let config = Config::default(); let ctx = egui::Context::default(); let (map, remote, data_holder) = Map::new(ctx); MapApp::new(map, remote, data_holder, config, None)