pkg/freetype: unknown errors should be reported, not unreachable

This commit is contained in:
Mitchell Hashimoto
2024-01-05 21:08:39 -08:00
parent 962be81f71
commit efd196e5c9

View File

@ -94,6 +94,7 @@ pub const Error = error{
BbxTooBig, BbxTooBig,
CorruptedFontHeader, CorruptedFontHeader,
CorruptedFontGlyphs, CorruptedFontGlyphs,
UnknownFreetypeError,
}; };
pub fn intToError(err: c_int) Error!void { pub fn intToError(err: c_int) Error!void {
@ -188,7 +189,7 @@ pub fn intToError(err: c_int) Error!void {
c.FT_Err_Bbx_Too_Big => Error.BbxTooBig, c.FT_Err_Bbx_Too_Big => Error.BbxTooBig,
c.FT_Err_Corrupted_Font_Header => Error.CorruptedFontHeader, c.FT_Err_Corrupted_Font_Header => Error.CorruptedFontHeader,
c.FT_Err_Corrupted_Font_Glyphs => Error.CorruptedFontGlyphs, c.FT_Err_Corrupted_Font_Glyphs => Error.CorruptedFontGlyphs,
else => unreachable, else => Error.UnknownFreetypeError,
}; };
} }