Closed mkroehnert closed 2 years ago
I named the feature flag serde-serialize, same as in the wasm-bindgen crate.
I think other crates call it use-serde
: https://github.com/georust/geo/blob/master/geo/Cargo.toml#L30-L33. serde-serialize
is a bit misleading -- before reading the code I thought it only included serialization.
@lnicola thanks for the review. I rename the feature to use-serde
and applied your fix.
And finally, can you add a changelog entry?
I think this is fine otherwise, but I'll give it a day or so in case anyone else wants to take a look.
@lnicola done. Thank you very much for the reviews.
bors r+
[x] I added an entry to
CHANGELOG.md
if knowledge of this change could be valuable to users.This PR resolves #59, by implementing optional support for (de-)serializing the GPX structs via serde.
I named the feature flag
serde-serialize
, same as in thewasm-bindgen
crate. Usingserde
for the feature flag name is not yet possible, since it would require the currently unstable cargo namespaced features implementation. See also the related cargo tracking issue.It was asked in #59, whether it would be possible to use GeoJSON, but for my usecase, it would be overkill to deal with additional data structure conversions. I also checked the Rust API guidelines, which mention that it would be good, if structs implemented
serde::{Serialize, Deserialize}
.If the changes are okay and can/should be merged, I'll update the branch with a changelog entry.