Skip to content

Commit

Permalink
Remove redundant ErrorKind::UnexpectedTag
Browse files Browse the repository at this point in the history
  • Loading branch information
madig committed Jan 5, 2022
1 parent a5c2a36 commit 5129e7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,6 @@ pub enum ErrorKind {
/// Missing a close tag.
#[error("missing close tag")]
MissingCloseTag,
/// Has an unexpected tag.
#[error("unexpected tag")]
UnexpectedTag,
/// Has an invalid hexadecimal value.
#[error("bad hex value")]
BadHexValue,
Expand Down
8 changes: 4 additions & 4 deletions src/glyph/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl<'names> GlifParser<'names> {
seen_note = true;
self.parse_note(reader, buf)?
}
_other => return Err(ErrorKind::UnexpectedTag.into()),
_other => return Err(ErrorKind::UnexpectedElement.into()),
},
// The rest are expected to be empty element tags (exception: outline) with attributes.
Event::Empty(start) => match start.name() {
Expand Down Expand Up @@ -124,7 +124,7 @@ impl<'names> GlifParser<'names> {
seen_image = true;
self.parse_image(reader, start)?
}
_other => return Err(ErrorKind::UnexpectedTag.into()),
_other => return Err(ErrorKind::UnexpectedElement.into()),
},
Event::End(ref end) if end.name() == b"glyph" => break,
_other => return Err(ErrorKind::MissingCloseTag.into()),
Expand Down Expand Up @@ -156,7 +156,7 @@ impl<'names> GlifParser<'names> {
b"contour" => {
self.parse_contour(start, reader, &mut new_buf, &mut outline_builder)?
}
_other => return Err(ErrorKind::UnexpectedTag.into()),
_other => return Err(ErrorKind::UnexpectedElement.into()),
}
}
Event::Empty(start) => {
Expand All @@ -165,7 +165,7 @@ impl<'names> GlifParser<'names> {
b"component" => {
self.parse_component(reader, start, &mut outline_builder)?
}
_other => return Err(ErrorKind::UnexpectedTag.into()),
_other => return Err(ErrorKind::UnexpectedElement.into()),
}
}
Event::End(ref end) if end.name() == b"outline" => break,
Expand Down

0 comments on commit 5129e7a

Please sign in to comment.