diff options
author | Andrew Gallant <jamslam@gmail.com> | 2017-11-29 16:19:21 -0500 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2017-11-29 16:28:56 -0500 |
commit | 1163111367cef7a85d48cb5b84d7889458d23974 (patch) | |
tree | 5c483def574321ae537398d6950974468a7d8b96 /src/io.rs | |
parent | fde8463d25dce294cd0a8e6e167c9fe98438ecd4 (diff) | |
download | byteorder-1163111367cef7a85d48cb5b84d7889458d23974.tar.gz |
remove unnecessary unsafe
See also #105
Fixes #103
Diffstat (limited to 'src/io.rs')
-rw-r--r-- | src/io.rs | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -509,7 +509,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_u16_into<T: ByteOrder>(&mut self, dst: &mut [u16]) -> Result<()> { { - let mut buf = unsafe { slice_to_u8_mut(dst) }; + let buf = unsafe { slice_to_u8_mut(dst) }; try!(self.read_exact(buf)); } T::from_slice_u16(dst); @@ -544,7 +544,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_u32_into<T: ByteOrder>(&mut self, dst: &mut [u32]) -> Result<()> { { - let mut buf = unsafe { slice_to_u8_mut(dst) }; + let buf = unsafe { slice_to_u8_mut(dst) }; try!(self.read_exact(buf)); } T::from_slice_u32(dst); @@ -582,7 +582,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_u64_into<T: ByteOrder>(&mut self, dst: &mut [u64]) -> Result<()> { { - let mut buf = unsafe { slice_to_u8_mut(dst) }; + let buf = unsafe { slice_to_u8_mut(dst) }; try!(self.read_exact(buf)); } T::from_slice_u64(dst); @@ -659,7 +659,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_i16_into<T: ByteOrder>(&mut self, dst: &mut [i16]) -> Result<()> { { - let mut buf = unsafe { slice_to_u8_mut(dst) }; + let buf = unsafe { slice_to_u8_mut(dst) }; try!(self.read_exact(buf)); } T::from_slice_i16(dst); @@ -694,7 +694,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_i32_into<T: ByteOrder>(&mut self, dst: &mut [i32]) -> Result<()> { { - let mut buf = unsafe { slice_to_u8_mut(dst) }; + let buf = unsafe { slice_to_u8_mut(dst) }; try!(self.read_exact(buf)); } T::from_slice_i32(dst); @@ -732,7 +732,7 @@ pub trait ReadBytesExt: io::Read { #[inline] fn read_i64_into<T: ByteOrder>(&mut self, dst: &mut [i64]) -> Result<()> { { - let mut buf = unsafe { slice_to_u8_mut(dst) }; + let buf = unsafe { slice_to_u8_mut(dst) }; try!(self.read_exact(buf)); } T::from_slice_i64(dst); @@ -826,7 +826,7 @@ pub trait ReadBytesExt: io::Read { dst: &mut [f32], ) -> Result<()> { { - let mut buf = slice_to_u8_mut(dst); + let buf = slice_to_u8_mut(dst); try!(self.read_exact(buf)); } T::from_slice_f32(dst); @@ -878,7 +878,7 @@ pub trait ReadBytesExt: io::Read { dst: &mut [f64], ) -> Result<()> { { - let mut buf = slice_to_u8_mut(dst); + let buf = slice_to_u8_mut(dst); try!(self.read_exact(buf)); } T::from_slice_f64(dst); |