Skip to content

Commit

Permalink
Merge pull request rust-lang#6 from mvdnes/add_ref
Browse files Browse the repository at this point in the history
Add reference operator to arguments as needed
  • Loading branch information
alexcrichton committed Nov 19, 2014
2 parents cbac14c + d6537a3 commit b0cdf68
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion miniz-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"]);
}
4 changes: 2 additions & 2 deletions src/gz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ impl<R: Reader> EncoderReader<R> {
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,
Expand Down Expand Up @@ -379,7 +379,7 @@ impl<R: Reader> DecoderReader<R> {
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 = {
Expand Down
8 changes: 4 additions & 4 deletions src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<W: Writer> EncoderWriter<W> {
}

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);
Expand All @@ -66,7 +66,7 @@ impl<W: Writer> Writer for EncoderWriter<W> {

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()
}
Expand Down Expand Up @@ -129,7 +129,7 @@ impl<W: Writer> DecoderWriter<W> {
}

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);
Expand All @@ -145,7 +145,7 @@ impl<W: Writer> Writer for DecoderWriter<W> {

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()
}
Expand Down

0 comments on commit b0cdf68

Please sign in to comment.