mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-29 01:13:53 +03:00
Log warnings when stripping out broken commands from edits
This commit is contained in:
parent
57584a61b9
commit
98b350418d
@ -172,7 +172,7 @@ impl PermanentMapEdits {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Transform permanent edits to MapEdits, looking up the map IDs by the hopefully stabler OSM
|
/// Transform permanent edits to MapEdits, looking up the map IDs by the hopefully stabler OSM
|
||||||
/// IDs. Strip out commands that're broken.
|
/// IDs. Strip out commands that're broken, but log warnings.
|
||||||
pub fn into_edits_permissive(self, map: &Map) -> MapEdits {
|
pub fn into_edits_permissive(self, map: &Map) -> MapEdits {
|
||||||
let mut edits = MapEdits {
|
let mut edits = MapEdits {
|
||||||
edits_name: self.edits_name,
|
edits_name: self.edits_name,
|
||||||
@ -181,7 +181,13 @@ impl PermanentMapEdits {
|
|||||||
commands: self
|
commands: self
|
||||||
.commands
|
.commands
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(|cmd| cmd.into_cmd(map).ok())
|
.filter_map(|cmd| match cmd.into_cmd(map) {
|
||||||
|
Ok(cmd) => Some(cmd),
|
||||||
|
Err(err) => {
|
||||||
|
warn!("Skipping broken command: {}", err);
|
||||||
|
None
|
||||||
|
}
|
||||||
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
merge_zones: self.merge_zones,
|
merge_zones: self.merge_zones,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user