pub fn label_as_str(&self) -> &'a str {
        let array = self.label();
        let len = array
            .iter()
            .position(|b| *b == 0 || *b == 0xff)
            .unwrap_or(array.len());
        unsafe {
            core::str::from_utf8_unchecked(core::slice::from_raw_parts(array.as_ptr().cast(), len))
        }
    }
The label of the partition as `&str`.
esp-bootloader-esp-idf/src/partitions.rs