Skip to content

Commit

Permalink
Merge pull request #239 from linebender/misc-changes
Browse files Browse the repository at this point in the history
Miscellaneous changes
  • Loading branch information
madig authored Jan 7, 2022
2 parents 47ff135 + ec81873 commit d1fd5b1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ impl std::fmt::Display for ErrorKind {
BadGuideline => write!(f, "bad guideline"),
BadComponent => write!(f, "bad component"),
BadImage => write!(f, "bad image"),
BadIdentifier => write!(f, "bad identifier"),
BadIdentifier => write!(f, "an identifier must be at most 100 characters long and contain only ASCII characters in the range 0x20 to 0x7E"),
BadLib => write!(f, "bad lib"),
UnexpectedDuplicate => write!(f, "unexpected duplicate"),
UnexpectedMove => {
Expand Down
3 changes: 2 additions & 1 deletion src/glyph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ pub struct Contour {
}

impl Contour {
fn is_closed(&self) -> bool {
/// Whether the contour is closed.
pub fn is_closed(&self) -> bool {
self.points.first().map_or(true, |v| v.typ != PointType::Move)
}

Expand Down
2 changes: 1 addition & 1 deletion src/identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ impl<'de> Deserialize<'de> for Identifier {
D: Deserializer<'de>,
{
let string = String::deserialize(deserializer)?;
Identifier::new(string).map_err(|_| de::Error::custom("Identifier must be at most 100 characters long and contain only ASCII characters in the range 0x20 to 0x7E."))
Identifier::new(string).map_err(de::Error::custom)
}
}

0 comments on commit d1fd5b1

Please sign in to comment.