Skip to content

Commit

Permalink
[write-fonts] Make fields on BuilderError public
Browse files Browse the repository at this point in the history
This will let me update fontc so that we can dump graphviz files when
table packing fails.
  • Loading branch information
cmyr committed Aug 25, 2023
1 parent 4c071e6 commit f2011fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion write-fonts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "write-fonts"
version = "0.14.1"
version = "0.14.2"
edition = "2021"
license = "MIT/Apache-2.0"
description = "Writing font files."
Expand Down
13 changes: 10 additions & 3 deletions write-fonts/src/font_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ pub struct FontBuilder<'a> {
/// This wraps a compilation error, adding the tag of the table where it was
/// encountered.
#[derive(Clone, Debug)]
#[non_exhaustive]
pub struct BuilderError {
tag: Tag,
inner: crate::error::Error,
/// The tag of the root table where the error occured
pub tag: Tag,
/// The underlying error
pub inner: crate::error::Error,
}

impl TableDirectory {
Expand Down Expand Up @@ -167,7 +170,11 @@ impl Display for BuilderError {
}
}

impl std::error::Error for BuilderError {}
impl std::error::Error for BuilderError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
Some(&self.inner)
}
}

#[cfg(test)]
mod tests {
Expand Down

0 comments on commit f2011fa

Please sign in to comment.