Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
miseyu committed Dec 2, 2024
1 parent f3104d8 commit e74090d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions nusamai-citygml/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,9 +1106,8 @@ impl<'b, R: BufRead> SubTreeReader<'_, 'b, R> {
let mut depth = 1;
loop {
match self.reader.read_resolved_event_into(&mut self.state.buf1) {
Ok((Bound(GML31_NS), Event::Start(start))) => {
Ok((Bound(GML31_NS), Event::Start(_))) => {
depth += 1;
println!("depth: {}, start: {:?}", depth, start.local_name());
}
Ok((_, Event::Start(start))) => {
return Err(ParseError::SchemaViolation(format!(
Expand All @@ -1131,7 +1130,10 @@ impl<'b, R: BufRead> SubTreeReader<'_, 'b, R> {
}
// parse coordinate sequence
self.state.fp_buf.clear();
for s in text.unescape().unwrap().split_ascii_whitespace() {
let unescaped_text = text
.unescape()
.map_err(|e| ParseError::InvalidValue(format!("Unescape error: {}", e)))?;
for s in unescaped_text.split_ascii_whitespace() {
if let Ok(v) = s.parse() {
self.state.fp_buf.push(v);
} else {
Expand Down Expand Up @@ -1286,7 +1288,10 @@ impl<'b, R: BufRead> SubTreeReader<'_, 'b, R> {

// parse coordinate sequence
self.state.fp_buf.clear();
for s in text.unescape().unwrap().split_ascii_whitespace() {
let unescaped_text = text
.unescape()
.map_err(|e| ParseError::InvalidValue(format!("Unescape error: {}", e)))?;
for s in unescaped_text.split_ascii_whitespace() {
if let Ok(v) = s.parse() {
self.state.fp_buf.push(v);
} else {
Expand Down

0 comments on commit e74090d

Please sign in to comment.