mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-26 20:00:32 +00:00
Replace unsafe with new std API (#4178)
* Replace unsafe with new std API * bump * Fix link in readme --------- Co-authored-by: Dániel Buga <bugadani@gmail.com>
This commit is contained in:
parent
c233ca70fe
commit
a47f0b8a4b
@ -2,7 +2,7 @@
|
||||
name = "esp-bootloader-esp-idf"
|
||||
version = "0.2.0"
|
||||
edition = "2024"
|
||||
rust-version = "1.86.0"
|
||||
rust-version = "1.88.0"
|
||||
description = "Functionality related to the esp-idf bootloader"
|
||||
documentation = "https://docs.espressif.com/projects/rust/esp-bootloader-esp-idf/latest/"
|
||||
keywords = ["esp32", "espressif", "no-std"]
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
[](https://crates.io/crates/esp-bootloader-esp-idf)
|
||||
[](https://docs.espressif.com/projects/rust/esp-bootloader-esp-idf/latest/)
|
||||

|
||||

|
||||

|
||||
[](https://matrix.to/#/#esp-rs:matrix.org)
|
||||
|
||||
|
@ -199,7 +199,8 @@ impl<'a> PartitionTable<'a> {
|
||||
return Err(Error::Invalid);
|
||||
}
|
||||
|
||||
if binary.len() % RAW_ENTRY_LEN != 0 {
|
||||
let (binary, rem) = binary.as_chunks::<RAW_ENTRY_LEN>();
|
||||
if !rem.is_empty() {
|
||||
return Err(Error::Invalid);
|
||||
}
|
||||
|
||||
@ -210,14 +211,6 @@ impl<'a> PartitionTable<'a> {
|
||||
});
|
||||
}
|
||||
|
||||
// we checked binary before
|
||||
let binary = unsafe {
|
||||
core::slice::from_raw_parts(
|
||||
binary.as_ptr() as *const [u8; RAW_ENTRY_LEN],
|
||||
binary.len() / RAW_ENTRY_LEN,
|
||||
)
|
||||
};
|
||||
|
||||
let mut raw_table = Self {
|
||||
binary,
|
||||
entries: binary.len(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user