georust / geozero

Zero-Copy reading and writing of geospatial data.
Apache License 2.0
323 stars 30 forks source link

Re-export prost::Message for mvt #95

Closed Tristramg closed 1 year ago

Tristramg commented 1 year ago

The origin of this pull request was a problem on maplibre-rs: https://github.com/maplibre/maplibre-rs/pull/235

An mvt tile is a protobuf message, parsed with the prost library. That library gives us a trait to be able to

geozero::mvt::Tile::decode(raw_data)

However, the trait must be in the scope.

Until now, the solution was to have prost as an extra dependency and do

use prost::Message

This is a problem when the versions are not equivalent in a SemVer sense as it might break randomly.

This commits allows the program that uses geozero::mvt to do

use geozero::mvt::Message

and no longer have an explicit dependency to prost, and we no longer have the risk of version mismatch.

pka commented 1 year ago

Thanks!

maxammann commented 1 year ago

Thanks for merging swiftly :) That should make maplibre-rs builds more stable!