diff --git a/core/embed/rust/src/trezorhal/slip39.rs b/core/embed/rust/src/trezorhal/slip39.rs index 7ccaba95b..6d061c885 100644 --- a/core/embed/rust/src/trezorhal/slip39.rs +++ b/core/embed/rust/src/trezorhal/slip39.rs @@ -1,3 +1,4 @@ +use core::str; use cstr_core::CStr; use super::ffi; @@ -25,6 +26,6 @@ pub fn button_sequence_to_word(prefix: u16) -> Option<&'static str> { } else { // SAFETY: On success, `button_sequence_to_word` should return a 0-terminated // UTF-8 string with static lifetime. - Some(unsafe { CStr::from_ptr(word).to_str().unwrap_unchecked() }) + Some(unsafe { str::from_utf8_unchecked(CStr::from_ptr(word).to_bytes()) }) } }