1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-10 14:42:44 +00:00

chore(core): remove unused code

[no changelog]
This commit is contained in:
cepetr 2025-02-04 12:11:43 +01:00
parent d8819cf0af
commit 13f948a8e6

View File

@ -88,30 +88,6 @@ impl<'a> BinaryData<'a> {
self.len() == 0
}
/// Returns a reference to the binary data.
///
/// This function is used just in the `paint()` functions in
/// UI components, that are going to be deleted after adopting new
/// drawing library for models T and TS3. Do not use this function in new
/// code.
///
/// # Safety
/// The caller must ensure that the returned slice is not modified by
/// MicroPython. This means (a) discarding the slice before returning
/// to Python, and (b) being careful about calling into Python while
/// the slice is held.
pub unsafe fn data(&self) -> &[u8] {
match self {
Self::Slice(data) => data,
// SAFETY: We expect no existing mutable reference. See safety
// note above.
#[cfg(feature = "micropython")]
Self::Object(obj) => unsafe { unwrap!(get_buffer(*obj)) },
#[cfg(feature = "micropython")]
Self::AllocatedSlice(data) => data,
}
}
/// Returns the length of the binary data in bytes.
pub fn len(&self) -> usize {
match self {