Skip to content

Commit

Permalink
Use roxmltree/std to get an error implementation and make using it mo…
Browse files Browse the repository at this point in the history
…re ergonomic
  • Loading branch information
dabreegster committed Jan 5, 2021
1 parent e99def9 commit eb9bf77
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion convert_osm/Cargo.toml
Expand Up @@ -13,5 +13,5 @@ geom = { path = "../geom" }
kml = { path = "../kml" }
log = "0.4.11"
map_model = { path = "../map_model" }
roxmltree = "0.14.0"
roxmltree = { version = "0.14.0", features=["std"] }
serde = "1.0.116"
2 changes: 1 addition & 1 deletion convert_osm/src/reader.rs
Expand Up @@ -45,7 +45,7 @@ pub fn read(path: &str, input_gps_bounds: &GPSBounds, timer: &mut Timer) -> Resu
timer.start(format!("read {}", path));
let bytes = slurp_file(path)?;
let raw_string = std::str::from_utf8(&bytes)?;
let tree = roxmltree::Document::parse(raw_string).map_err(|err| anyhow!("{}", err))?;
let tree = roxmltree::Document::parse(raw_string)?;
timer.stop(format!("read {}", path));

let mut doc = Document {
Expand Down
2 changes: 1 addition & 1 deletion kml/Cargo.toml
Expand Up @@ -10,5 +10,5 @@ abstutil = { path = "../abstutil" }
anyhow = "1.0.37"
csv = "1.1.4"
geom = { path = "../geom" }
roxmltree = "0.14.0"
roxmltree = { version = "0.14.0", features=["std"] }
serde = "1.0.116"
2 changes: 1 addition & 1 deletion kml/src/lib.rs
Expand Up @@ -41,7 +41,7 @@ pub fn load(
timer.start(format!("read {}", path));
let bytes = abstio::slurp_file(path)?;
let raw_string = std::str::from_utf8(&bytes)?;
let tree = roxmltree::Document::parse(raw_string).map_err(|err| anyhow!("{}", err))?;
let tree = roxmltree::Document::parse(raw_string)?;
timer.stop(format!("read {}", path));

let mut shapes = Vec::new();
Expand Down

0 comments on commit eb9bf77

Please sign in to comment.