From f3739fdfb5b776c00087f2093a6cedb7ad1557c4 Mon Sep 17 00:00:00 2001 From: Woshiluo Luo Date: Sun, 13 Apr 2025 16:20:07 +0800 Subject: [PATCH] feat: remove ptr_metadata to remove all nightly feature Signed-off-by: Woshiluo Luo --- src/de.rs | 3 ++- src/lib.rs | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/de.rs b/src/de.rs index 2998e4b..a5ff2c7 100644 --- a/src/de.rs +++ b/src/de.rs @@ -78,7 +78,8 @@ where let total_size = u32::from_be(header.total_size); let raw_data_len = (total_size - HEADER_LEN) as usize; - let ans_ptr = core::ptr::from_raw_parts(ptr, raw_data_len); + let ans_ptr = core::ptr::slice_from_raw_parts(ptr, raw_data_len); + let ans_ptr = ans_ptr as *const DeviceTree; let device_tree: &DeviceTree = &*ans_ptr; let tags = device_tree.tags(); let mut d = Deserializer { diff --git a/src/lib.rs b/src/lib.rs index c8d4452..e77b242 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,7 +12,6 @@ //! one with no-std support, //! the other one doesn't even need alloc. -#![feature(ptr_metadata)] #![cfg_attr(not(feature = "std"), no_std)] #[cfg(feature = "alloc")]