Function map_model::edits::compat::upgrade

source ·
pub fn upgrade(value: Value, map: &Map) -> Result<PermanentMapEdits>
Expand description

When the PermanentMapEdits format changes, add a transformation here to automatically convert edits written with the old format.

This problem is often solved with something like protocol buffers, but the resulting proto usually winds up with permanent legacy fields, unless the changes are purely additive. For example, protobufs wouldn’t have helped with the fix_intersection_ids problem. Explicit transformation is easier!