Skip to content

Commit

Permalink
Fix a TODO, use Box<[T]> instead of Vec<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Sep 9, 2015
1 parent 00023b2 commit 3f3432b
Showing 1 changed file with 3 additions and 3 deletions.
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: Vec<u8>, // TODO: this should be Box<[u8]>
buf: Box<[u8]>,
pos: usize,
cap: usize,
}
Expand Down Expand Up @@ -175,7 +175,7 @@ impl<R: Read> EncoderReader<R> {
EncoderReader(InnerRead {
inner: w,
stream: Stream::new_compress(level, raw),
buf: buf,
buf: buf.into_boxed_slice(),
cap: 0,
pos: 0,
})
Expand All @@ -195,7 +195,7 @@ impl<R: Read> DecoderReader<R> {
DecoderReader(InnerRead {
inner: r,
stream: Stream::new_decompress(raw),
buf: buf,
buf: buf.into_boxed_slice(),
pos: 0,
cap: 0,
})
Expand Down

0 comments on commit 3f3432b

Please sign in to comment.