aboutsummaryrefslogtreecommitdiff
path: root/src/io.rs
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2017-11-29 16:19:21 -0500
committerAndrew Gallant <jamslam@gmail.com>2017-11-29 16:28:56 -0500
commit1163111367cef7a85d48cb5b84d7889458d23974 (patch)
tree5c483def574321ae537398d6950974468a7d8b96 /src/io.rs
parentfde8463d25dce294cd0a8e6e167c9fe98438ecd4 (diff)
downloadbyteorder-1163111367cef7a85d48cb5b84d7889458d23974.tar.gz
remove unnecessary unsafe
See also #105 Fixes #103
Diffstat (limited to 'src/io.rs')
-rw-r--r--src/io.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/io.rs b/src/io.rs
index 208596a..a4c4fb4 100644
--- a/src/io.rs
+++ b/src/io.rs
@@ -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);