Skip to content

Commit

Permalink
Fix lint warnings/errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Mar 27, 2015
1 parent c59ddd6 commit 3e2ebd1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#![doc(html_root_url = "http://alexcrichton.com/flate2-rs")]
#![feature(io, unsafe_destructor)]
#![deny(missing_docs)]
#![allow(trivial_numeric_casts)]
#![cfg_attr(test, deny(warnings))]

extern crate libc;
Expand Down
10 changes: 5 additions & 5 deletions src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ impl<T: Direction> Stream<T> {
impl Stream<Decompress> {
pub fn decompress(&mut self, input: &[u8], output: &mut [u8],
flush: Flush) -> c_int {
self.raw.next_in = input.as_ptr() as *mut _;
self.raw.next_in = input.as_ptr();
self.raw.avail_in = input.len() as c_uint;
self.raw.next_out = output.as_mut_ptr() as *mut _;
self.raw.next_out = output.as_mut_ptr();
self.raw.avail_out = output.len() as c_uint;
unsafe { ffi::mz_inflate(&mut self.raw, flush as c_int) }
}
Expand All @@ -84,7 +84,7 @@ impl Stream<Decompress> {
self.raw.avail_out = (cap - len) as c_uint;

unsafe {
self.raw.next_out = output.as_mut_ptr().offset(len as isize) as *mut _;
self.raw.next_out = output.as_mut_ptr().offset(len as isize);
let before = self.total_out();
let rc = ffi::mz_inflate(&mut self.raw, flush as c_int);
let diff = (self.total_out() - before) as usize;
Expand All @@ -99,7 +99,7 @@ impl Stream<Compress> {
flush: Flush) -> c_int {
self.raw.next_in = input.as_ptr() as *mut _;
self.raw.avail_in = input.len() as c_uint;
self.raw.next_out = output.as_mut_ptr() as *mut _;
self.raw.next_out = output.as_mut_ptr();
self.raw.avail_out = output.len() as c_uint;
unsafe { ffi::mz_deflate(&mut self.raw, flush as c_int) }
}
Expand All @@ -113,7 +113,7 @@ impl Stream<Compress> {
self.raw.avail_out = (cap - len) as c_uint;

unsafe {
self.raw.next_out = output.as_mut_ptr().offset(len as isize) as *mut _;
self.raw.next_out = output.as_mut_ptr().offset(len as isize);

let before = self.total_out();
let rc = ffi::mz_deflate(&mut self.raw, flush as c_int);
Expand Down

0 comments on commit 3e2ebd1

Please sign in to comment.