diff --git a/src/buffer/immutable.rs b/src/buffer/immutable.rs index 1d7e77add63..6abae156a9b 100644 --- a/src/buffer/immutable.rs +++ b/src/buffer/immutable.rs @@ -1,7 +1,5 @@ use std::{iter::FromIterator, ops::Deref, sync::Arc, usize}; -use crate::types::NativeType; - use super::Bytes; /// [`Buffer`] is a contiguous memory region of plain old data types @@ -34,7 +32,7 @@ use super::Bytes; /// assert_eq!(buffer.get_mut(), None); /// ``` #[derive(Clone)] -pub struct Buffer { +pub struct Buffer { /// the internal byte buffer. data: Arc>, @@ -46,27 +44,27 @@ pub struct Buffer { length: usize, } -impl PartialEq for Buffer { +impl PartialEq for Buffer { #[inline] fn eq(&self, other: &Self) -> bool { self.deref() == other.deref() } } -impl std::fmt::Debug for Buffer { +impl std::fmt::Debug for Buffer { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Debug::fmt(&**self, f) } } -impl Default for Buffer { +impl Default for Buffer { #[inline] fn default() -> Self { Vec::new().into() } } -impl Buffer { +impl Buffer { /// Creates an empty [`Buffer`]. #[inline] pub fn new() -> Self { @@ -169,7 +167,7 @@ impl Buffer { } } -impl From> for Buffer { +impl From> for Buffer { #[inline] fn from(p: Vec) -> Self { let bytes: Bytes = p.into(); @@ -181,7 +179,7 @@ impl From> for Buffer { } } -impl std::ops::Deref for Buffer { +impl std::ops::Deref for Buffer { type Target = [T]; #[inline] @@ -190,7 +188,7 @@ impl std::ops::Deref for Buffer { } } -impl FromIterator for Buffer { +impl FromIterator for Buffer { #[inline] fn from_iter>(iter: I) -> Self { Vec::from_iter(iter).into()