Skip to content

Commit

Permalink
Remove usage of the collections feature
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Mar 9, 2015
1 parent 04555a3 commit 931360f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/deflate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ mod tests {
let v = thread_rng().gen_iter::<u8>().take(1024).collect::<Vec<_>>();
for _ in 0..200 {
let to_write = &v[..thread_rng().gen_range(0, v.len())];
real.push_all(to_write);
real.extend(to_write.iter().map(|x| *x));
w.write_all(to_write).unwrap();
}
let result = w.finish().unwrap();
Expand Down
8 changes: 4 additions & 4 deletions src/gz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,21 +143,21 @@ impl Builder {
flg |= FEXTRA;
header.push((v.len() >> 0) as u8);
header.push((v.len() >> 8) as u8);
header.push_all(&v);
header.extend(v);
}
None => {}
}
match filename {
Some(filename) => {
flg |= FNAME;
header.push_all(filename.as_bytes_with_nul());
header.extend(filename.as_bytes_with_nul().iter().map(|x| *x));
}
None => {}
}
match comment {
Some(comment) => {
flg |= FCOMMENT;
header.push_all(comment.as_bytes_with_nul());
header.extend(comment.as_bytes_with_nul().iter().map(|x| *x));
}
None => {}
}
Expand Down Expand Up @@ -497,7 +497,7 @@ mod tests {
let v = thread_rng().gen_iter::<u8>().take(1024).collect::<Vec<_>>();
for _ in 0..200 {
let to_write = &v[..thread_rng().gen_range(0, v.len())];
real.push_all(to_write);
real.extend(to_write.iter().map(|x| *x));
w.write_all(to_write).unwrap();
}
let result = w.finish().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
//! already existing stream to chain construction.

#![doc(html_root_url = "http://alexcrichton.com/flate2-rs")]
#![feature(io, collections)]
#![feature(io)]
#![deny(missing_docs)]
#![feature(unsafe_destructor)]
#![cfg_attr(test, deny(warnings))]
Expand Down
6 changes: 3 additions & 3 deletions src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct DecoderReader<R: Read>(InnerRead<R, Decompress>);
struct InnerRead<R, D: Direction> {
inner: R,
stream: Stream<D>,
buf: Box<[u8]>,
buf: Vec<u8>, // TODO: this should be Box<[u8]>
pos: usize,
cap: usize,
}
Expand Down Expand Up @@ -161,7 +161,7 @@ impl<R: Read> EncoderReader<R> {
EncoderReader(InnerRead {
inner: w,
stream: Stream::new_compress(level, raw),
buf: buf.into_boxed_slice(),
buf: buf,
cap: 0,
pos: 0,
})
Expand All @@ -181,7 +181,7 @@ impl<R: Read> DecoderReader<R> {
DecoderReader(InnerRead {
inner: r,
stream: Stream::new_decompress(raw),
buf: buf.into_boxed_slice(),
buf: buf,
pos: 0,
cap: 0,
})
Expand Down
2 changes: 1 addition & 1 deletion src/zlib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ mod tests {
let v = thread_rng().gen_iter::<u8>().take(1024).collect::<Vec<_>>();
for _ in 0..200 {
let to_write = &v[..thread_rng().gen_range(0, v.len())];
real.push_all(to_write);
real.extend(to_write.iter().map(|x| *x));
w.write_all(to_write).unwrap();
}
let result = w.finish().unwrap();
Expand Down

0 comments on commit 931360f

Please sign in to comment.