diff --git a/src/header.rs b/src/header.rs deleted file mode 100644 index 1e5322d..0000000 --- a/src/header.rs +++ /dev/null @@ -1,28 +0,0 @@ -use crate::Base; -use core::slice::from_raw_parts; - -#[derive(Debug)] -pub struct Header { - base: Base, - len: usize, -} - -impl Header { - /// Returns a base pointer of this section. - #[inline] - pub fn base(&self) -> Base { - self.base - } - - /// Returns the length of this section. - #[inline] - #[allow(clippy::len_without_is_empty)] - pub fn len(&self) -> usize { - self.len - } - - #[inline] - pub fn as_slice(&self) -> &[u8] { - unsafe { from_raw_parts(self.base.as_nonnull().as_ptr(), self.len) } - } -} diff --git a/src/section.rs b/src/section.rs index e7b8839..8c113f8 100644 --- a/src/section.rs +++ b/src/section.rs @@ -61,6 +61,7 @@ impl Section { .map(|offset| unsafe { self.base.add(offset) }) } + #[inline] pub(crate) fn new(name: &'static str, base: Base, len: usize) -> Self { Self { name, base, len } }