-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-export serde_json::Map #185
Comments
2 tasks
bors bot
added a commit
that referenced
this issue
May 27, 2022
191: Reexport `JsonObject` and `JsonValue` from `serde_json`. r=michaelkirk a=frewsxcv - [x] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md). - [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users. --- Prior to this commit, users would need to add `serde_json` as a dependency in order to construct a `Feature` with properties. Fixes #185 Before: ```rust use geojson::{Feature, GeoJson, Geometry, Value}; use serde_json::{Map, to_value}; let geometry = Geometry::new( Value::Point(vec![-120.66029,35.2812]) ); let mut properties = Map::new(); properties.insert( String::from("name"), to_value("Firestone Grill").unwrap(), ); let geojson = GeoJson::Feature(Feature { bbox: None, geometry: Some(geometry), id: None, properties: Some(properties), foreign_members: None, }); ``` After: ```rust use geojson::{Feature, GeoJson, Geometry, Value, JsonObject, JsonValue}; let geometry = Geometry::new( Value::Point(vec![-120.66029,35.2812]) ); let mut properties = JsonObject::new(); properties.insert( String::from("name"), JsonValue::from("Firestone Grill"), ); let geojson = GeoJson::Feature(Feature { bbox: None, geometry: Some(geometry), id: None, properties: Some(properties), foreign_members: None, }); ``` Co-authored-by: Corey Farwell <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So users don't need to add serde_json as a dependency to construct a Feature
The text was updated successfully, but these errors were encountered: