diff options
Diffstat (limited to 'vendor/gimli/src/read/endian_slice.rs')
-rw-r--r-- | vendor/gimli/src/read/endian_slice.rs | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/vendor/gimli/src/read/endian_slice.rs b/vendor/gimli/src/read/endian_slice.rs index d0fd67c0b..fbf5cbb79 100644 --- a/vendor/gimli/src/read/endian_slice.rs +++ b/vendor/gimli/src/read/endian_slice.rs @@ -4,7 +4,7 @@ use alloc::borrow::Cow; #[cfg(feature = "read")] use alloc::string::String; -use core::ops::{Deref, Index, Range, RangeFrom, RangeTo}; +use core::ops::{Deref, Range, RangeFrom, RangeTo}; use core::str; use crate::endianity::Endianity; @@ -57,7 +57,7 @@ where (self.range_to(..idx), self.range_from(idx..)) } - /// Find the first occurence of a byte in the slice, and return its index. + /// Find the first occurrence of a byte in the slice, and return its index. #[inline] pub fn find(&self, byte: u8) -> Option<usize> { self.slice.iter().position(|ch| *ch == byte) @@ -167,26 +167,6 @@ where } } -impl<'input, Endian> Index<usize> for EndianSlice<'input, Endian> -where - Endian: Endianity, -{ - type Output = u8; - fn index(&self, idx: usize) -> &Self::Output { - &self.slice[idx] - } -} - -impl<'input, Endian> Index<RangeFrom<usize>> for EndianSlice<'input, Endian> -where - Endian: Endianity, -{ - type Output = [u8]; - fn index(&self, idx: RangeFrom<usize>) -> &Self::Output { - &self.slice[idx] - } -} - impl<'input, Endian> Deref for EndianSlice<'input, Endian> where Endian: Endianity, @@ -197,15 +177,6 @@ where } } -impl<'input, Endian> From<EndianSlice<'input, Endian>> for &'input [u8] -where - Endian: Endianity, -{ - fn from(endian_slice: EndianSlice<'input, Endian>) -> &'input [u8] { - endian_slice.slice - } -} - impl<'input, Endian> Reader for EndianSlice<'input, Endian> where Endian: Endianity, |