diff --git a/Package.resolved b/Package.resolved index d6c231bb..470b0036 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/maplibre/maplibre-gl-native-distribution.git", "state" : { - "revision" : "cf66f087af489ebc091c03cbd4f38d0540135871", - "version" : "6.5.3" + "revision" : "abe762f1e19e03a4c6943d2aad92c219da384b29", + "version" : "6.5.4" } }, { @@ -41,8 +41,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-snapshot-testing", "state" : { - "revision" : "e883fc9ea51e76dc9ed13fd4a92b0ee258a1e8c9", - "version" : "1.17.3" + "revision" : "6d932a79e7173b275b96c600c86c603cf84f153c", + "version" : "1.17.4" } }, { diff --git a/Package.swift b/Package.swift index 7c4b3693..5d1c62e8 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,7 @@ if useLocalFramework { path: "./common/target/ios/libferrostar-rs.xcframework" ) } else { - let releaseTag = "0.6.1" + let releaseTag = "0.7.0" let releaseChecksum = "f95a7e525ebfb66515fa24d37599b5bf2a91274999d2832933d5909081e6ad31" binaryTarget = .binaryTarget( name: "FerrostarCoreRS", diff --git a/android/gradle/libs.versions.toml b/android/gradle/libs.versions.toml index 857d5226..e45d5d72 100644 --- a/android/gradle/libs.versions.toml +++ b/android/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -agp = "8.5.1" +agp = "8.5.2" kotlin = "2.0.0" cargo-ndk = "0.3.4" ktfmt = "0.19.0" diff --git a/apple/Sources/UniFFI/ferrostar.swift b/apple/Sources/UniFFI/ferrostar.swift index e577a522..eaef5dd1 100644 --- a/apple/Sources/UniFFI/ferrostar.swift +++ b/apple/Sources/UniFFI/ferrostar.swift @@ -530,6 +530,11 @@ public protocol NavigationControllerProtocol: AnyObject { /** * Updates the user's current location and updates the navigation state accordingly. + * + * # Panics + * + * If there is no current step ([`TripState::Navigating`] has an empty `remainingSteps` value), + * this function will panic. */ func updateUserLocation(location: UserLocation, state: TripState) -> TripState } @@ -624,6 +629,11 @@ open class NavigationController: /** * Updates the user's current location and updates the navigation state accordingly. + * + * # Panics + * + * If there is no current step ([`TripState::Navigating`] has an empty `remainingSteps` value), + * this function will panic. */ open func updateUserLocation(location: UserLocation, state: TripState) -> TripState { try! FfiConverterTypeTripState.lift(try! rustCall { @@ -4021,7 +4031,7 @@ private var initializationResult: InitializationResult = { if uniffi_ferrostar_checksum_method_navigationcontroller_get_initial_state() != 63862 { return InitializationResult.apiChecksumMismatch } - if uniffi_ferrostar_checksum_method_navigationcontroller_update_user_location() != 43166 { + if uniffi_ferrostar_checksum_method_navigationcontroller_update_user_location() != 3165 { return InitializationResult.apiChecksumMismatch } if uniffi_ferrostar_checksum_method_routeadapter_generate_request() != 59034 { diff --git a/common/ferrostar/src/lib.rs b/common/ferrostar/src/lib.rs index 4680ebec..f0d5e8d8 100644 --- a/common/ferrostar/src/lib.rs +++ b/common/ferrostar/src/lib.rs @@ -109,11 +109,11 @@ fn create_osrm_response_parser(polyline_precision: u32) -> Arc, - waypoint_data: Vec, + route_data: &[u8], + waypoint_data: &[u8], polyline_precision: u32, ) -> Result { - let route: OsrmRoute = serde_json::from_slice(&route_data)?; - let waypoints: Vec = serde_json::from_slice(&waypoint_data)?; - return Route::from_osrm(&route, &waypoints, polyline_precision); + let route: OsrmRoute = serde_json::from_slice(route_data)?; + let waypoints: Vec = serde_json::from_slice(waypoint_data)?; + Route::from_osrm(&route, &waypoints, polyline_precision) } diff --git a/common/ferrostar/src/models.rs b/common/ferrostar/src/models.rs index 7d00d32d..55efb708 100644 --- a/common/ferrostar/src/models.rs +++ b/common/ferrostar/src/models.rs @@ -1,10 +1,10 @@ //! Common data models. //! //! Quick tour: -//! - [Route]: Common notion of what a route is; You can go top-down from here if you're curious. -//! - [Waypoint]: Points that a user is intending to traverse; interesting because there are multiple kinds of them. -//! - [SpokenInstruction] and [VisualInstruction]: Audiovisual prompts as the user progresses through the route. -//! - [GeographicCoordinate] and [BoundingBox]: Geographic primitives +//! - [`Route`]: Common notion of what a route is; You can go top-down from here if you're curious. +//! - [`Waypoint`]: Points that a user is intending to traverse; interesting because there are multiple kinds of them. +//! - [`SpokenInstruction`] and [`VisualInstruction`]: Audiovisual prompts as the user progresses through the route. +//! - [`GeographicCoordinate`] and [`BoundingBox`]: Geographic primitives //! (providing a shared language and type definition across multiple platforms). #[cfg(feature = "alloc")] diff --git a/common/ferrostar/src/navigation_controller/mod.rs b/common/ferrostar/src/navigation_controller/mod.rs index 6daa03a7..f876b231 100644 --- a/common/ferrostar/src/navigation_controller/mod.rs +++ b/common/ferrostar/src/navigation_controller/mod.rs @@ -160,6 +160,11 @@ impl NavigationController { } /// Updates the user's current location and updates the navigation state accordingly. + /// + /// # Panics + /// + /// If there is no current step ([`TripState::Navigating`] has an empty `remainingSteps` value), + /// this function will panic. pub fn update_user_location(&self, location: UserLocation, state: &TripState) -> TripState { match state { TripState::Idle => TripState::Idle, diff --git a/common/ferrostar/src/routing_adapters/osrm/mod.rs b/common/ferrostar/src/routing_adapters/osrm/mod.rs index 06b63895..20ab84e0 100644 --- a/common/ferrostar/src/routing_adapters/osrm/mod.rs +++ b/common/ferrostar/src/routing_adapters/osrm/mod.rs @@ -14,11 +14,9 @@ use crate::routing_adapters::{ ParsingError, Route, }; #[cfg(all(not(feature = "std"), feature = "alloc"))] -use alloc::{collections::BTreeSet as HashSet, string::ToString, vec, vec::Vec}; +use alloc::{string::ToString, vec, vec::Vec}; use geo::BoundingRect; use polyline::decode_polyline; -#[cfg(feature = "std")] -use std::collections::HashSet; use uuid::Uuid; /// A response parser for OSRM-compatible routing backends. @@ -40,18 +38,17 @@ impl RouteResponseParser for OsrmResponseParser { fn parse_response(&self, response: Vec) -> Result, ParsingError> { let res: RouteResponse = serde_json::from_slice(&response)?; - return res - .routes + res.routes .iter() .map(|route| Route::from_osrm(route, &res.waypoints, self.polyline_precision)) - .collect::, _>>(); + .collect::, _>>() } } impl Route { pub fn from_osrm( route: &OsrmRoute, - waypoints: &Vec, + waypoints: &[OsrmWaypoint], polyline_precision: u32, ) -> Result { let via_waypoint_indices: Vec<_> = route