Skip to content

Commit

Permalink
fix: update to GeocoderStatus to allow for round-tripping
Browse files Browse the repository at this point in the history
  • Loading branch information
leontoeides committed Nov 8, 2024
1 parent 85ad03f commit 87e8750
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
* Release notes are available on
[GitHub](https://github.com/leontoeides/google_maps/releases).

# 3.7.3

* 2024-11-07: Merged a patch for an enum to allow for round-tripping. Thank you
for the PR [xyres137](https://github.com/xyres137).

# 3.7.2

* 2024-11-07: Corrected issue with `Status` enums not round-tripping through
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "google_maps"
version = "3.7.2"
version = "3.7.3"
authors = ["Dylan Bowker <[email protected]>"]
edition = "2021"
categories = ["api-bindings"]
Expand Down
10 changes: 6 additions & 4 deletions src/directions/response/geocoder_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use phf::phf_map;
use serde::{Deserialize, Deserializer, Serialize};

// -----------------------------------------------------------------------------

//
/// Indicates the [status
/// code](https://developers.google.com/maps/documentation/directions/intro#GeocodedWaypoints)
/// resulting from the geocoding operation.
Expand All @@ -16,15 +16,17 @@ use serde::{Deserialize, Deserializer, Serialize};
pub enum GeocoderStatus {
/// Indicates that no errors occurred; the address was successfully parsed
/// and at least one geocode was returned.
#[serde(alias = "OK")]
#[serde(alias = "Ok")]
Ok,

/// Indicates that the geocode was successful but returned no results. This
/// may occur if the geocoder was passed a non-existent `address`.
#[serde(alias = "ZERO_RESULTS")]
#[serde(alias = "ZeroResults")]
ZeroResults,

/// Indicates that the request could not be processed due to a server error.
/// The request may succeed if you try again.
#[serde(alias = "UNKNOWN_ERROR")]
#[serde(alias = "UnknownError")]
UnknownError,
} // struct

Expand Down

0 comments on commit 87e8750

Please sign in to comment.