Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Not including a documentation nit for `as_raw_parts`

Co-authored-by: Philipp Oppermann <dev@phil-opp.com>
  • Loading branch information
mental32 and phil-opp committed Dec 28, 2020
1 parent a461975 commit dce08e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/structures/gdt.rs
Expand Up @@ -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."
Expand All @@ -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]
}

Expand Down

0 comments on commit dce08e9

Please sign in to comment.