1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-14 02:18:07 +00:00

fixup! fixup! refactor(core): safe iface for get_glyph_data

This commit is contained in:
obrusvit 2024-12-13 17:19:01 +01:00
parent 74a84516f9
commit fb7cf535a3
2 changed files with 4 additions and 2 deletions

View File

@ -259,7 +259,8 @@ impl<'a> Translations<'a> {
&self.header &self.header
} }
/// Returns a byte slice of the glyph data for the given UTF-8 codepoint in the specified font. /// Returns a byte slice of the glyph data for the given UTF-8 codepoint in
/// the specified font.
/// ///
/// SAFETY: Do not mess with the lifetimes in this signature. /// SAFETY: Do not mess with the lifetimes in this signature.
/// ///

View File

@ -180,7 +180,8 @@ impl GlyphData {
}) })
} }
/// Returns glyph data slice from a raw pointer by reading the header and calculating full size. /// Returns glyph data slice from a raw pointer by reading the header and
/// calculating full size.
unsafe fn load_glyph_from_ptr(&self, ptr: *const u8) -> &[u8] { unsafe fn load_glyph_from_ptr(&self, ptr: *const u8) -> &[u8] {
unsafe { unsafe {
let header = slice::from_raw_parts(ptr, 2); let header = slice::from_raw_parts(ptr, 2);