diff --git a/miniz-sys/build.rs b/miniz-sys/build.rs index 22c08333a..197ccc120 100644 --- a/miniz-sys/build.rs +++ b/miniz-sys/build.rs @@ -3,5 +3,5 @@ extern crate gcc; use std::default::Default; fn main() { - gcc::compile_library("libminiz.a", &Default::default(), ["miniz.c"]); + gcc::compile_library("libminiz.a", &Default::default(), &["miniz.c"]); } diff --git a/src/gz.rs b/src/gz.rs index 386efc69d..7b0ff01f2 100644 --- a/src/gz.rs +++ b/src/gz.rs @@ -259,7 +259,7 @@ impl EncoderReader { if self.pos == 8 { return Err(io::standard_error(io::EndOfFile)) } - let arr = [ + let ref arr = [ (self.inner.inner.crc().sum() >> 0) as u8, (self.inner.inner.crc().sum() >> 8) as u8, (self.inner.inner.crc().sum() >> 16) as u8, @@ -379,7 +379,7 @@ impl DecoderReader { pub fn header(&self) -> &Header { &self.header } fn finish(&mut self) -> IoResult<()> { - let mut buf = [0u8, ..8]; + let ref mut buf = [0u8, ..8]; { let flate = self.inner.inner(); let len = { diff --git a/src/raw.rs b/src/raw.rs index a4899be39..e15070cb7 100644 --- a/src/raw.rs +++ b/src/raw.rs @@ -50,7 +50,7 @@ impl EncoderWriter { } pub fn do_finish(&mut self) -> IoResult<()> { - try!(self.stream.write([], ffi::MZ_FINISH, &mut self.buf, + try!(self.stream.write(&[], ffi::MZ_FINISH, &mut self.buf, self.inner.as_mut().unwrap(), ffi::mz_deflate)); try!(self.inner.as_mut().unwrap().write(self.buf.as_slice())); self.buf.truncate(0); @@ -66,7 +66,7 @@ impl Writer for EncoderWriter { fn flush(&mut self) -> IoResult<()> { let inner = self.inner.as_mut().unwrap(); - try!(self.stream.write([], ffi::MZ_SYNC_FLUSH, &mut self.buf, inner, + try!(self.stream.write(&[], ffi::MZ_SYNC_FLUSH, &mut self.buf, inner, ffi::mz_deflate)); inner.flush() } @@ -129,7 +129,7 @@ impl DecoderWriter { } pub fn do_finish(&mut self) -> IoResult<()> { - try!(self.stream.write([], ffi::MZ_FINISH, &mut self.buf, + try!(self.stream.write(&[], ffi::MZ_FINISH, &mut self.buf, self.inner.as_mut().unwrap(), ffi::mz_inflate)); try!(self.inner.as_mut().unwrap().write(self.buf.as_slice())); self.buf.truncate(0); @@ -145,7 +145,7 @@ impl Writer for DecoderWriter { fn flush(&mut self) -> IoResult<()> { let inner = self.inner.as_mut().unwrap(); - try!(self.stream.write([], ffi::MZ_SYNC_FLUSH, &mut self.buf, inner, + try!(self.stream.write(&[], ffi::MZ_SYNC_FLUSH, &mut self.buf, inner, ffi::mz_inflate)); inner.flush() }