From dce08e90fbe2e33ce1bc8d1cfa0fbf8853822c26 Mon Sep 17 00:00:00 2001 From: mental Date: Mon, 28 Dec 2020 17:29:38 +0200 Subject: [PATCH] Apply suggestions from code review Not including a documentation nit for `as_raw_parts` Co-authored-by: Philipp Oppermann --- src/structures/gdt.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/structures/gdt.rs b/src/structures/gdt.rs index d80cf1352..1015a0484 100644 --- a/src/structures/gdt.rs +++ b/src/structures/gdt.rs @@ -112,8 +112,8 @@ impl GlobalDescriptorTable { /// * The user must make sure that the entries are well formed /// * The provided slice **must not be larger than 8 items** (only up to the first 8 will be observed.) #[inline] - #[cfg(feature = "nightly")] - pub const unsafe fn from_raw_parts(slice: &[u64]) -> GlobalDescriptorTable { + #[cfg(feature = "const_fn")] + pub const unsafe fn from_raw_slice(slice: &[u64]) -> GlobalDescriptorTable { assert!( slice.len() <= 8, "initializing a GDT from a slice requires it to be **at most** 8 elements." @@ -133,7 +133,7 @@ impl GlobalDescriptorTable { /// Get a reference to the internal table. #[inline] - pub fn as_raw_parts(&self) -> &[u64] { + pub fn as_raw_slice(&self) -> &[u64] { &self.table[..self.next_free] }