diff --git a/write-fonts/Cargo.toml b/write-fonts/Cargo.toml index 5badbddde..f591f6246 100644 --- a/write-fonts/Cargo.toml +++ b/write-fonts/Cargo.toml @@ -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." diff --git a/write-fonts/src/font_builder.rs b/write-fonts/src/font_builder.rs index 10f23c866..ff8353133 100644 --- a/write-fonts/src/font_builder.rs +++ b/write-fonts/src/font_builder.rs @@ -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 { @@ -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 {