Skip to content

Commit

Permalink
Remove the collections feature gate
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaka committed Apr 3, 2015
1 parent 8be414a commit 7f5712f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/gif/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,18 @@ where Container: Deref<Target=[u8]> + DerefMut {
bg_index = i;
}
}
table.push_all(channels)
table.extend(channels.iter().map(|&c| c))
}
// Waste some space as of gif spec
for _ in 0..((2 << n) - num_colors) {
table.push_all(&[0, 0, 0]);
table.extend([0, 0, 0].iter().map(|&c| c));
}
(Some(table), bg_index as u8)
} else if let Some(bg_color) = self.bg_color {
flags |= 1 << 7; // glocal table flag
let mut table = Vec::with_capacity(6);
table.push_all(&bg_color.channels()[..3]);
table.push_all(&[0, 0, 0]);
table.extend(bg_color.channels().iter().take(3).map(|&c| c));
table.extend([0, 0, 0].iter().map(|&c| c));
(Some(table), 0)
} else {
(None, 0)
Expand Down
6 changes: 3 additions & 3 deletions src/jpeg/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::cmp;
use std::slice;
use std::io::Read;
use std::default::Default;
use std::collections::vec_map::VecMap;
use std::collections::HashMap;
use std::iter::repeat;
use byteorder::{ReadBytesExt, BigEndian};

Expand Down Expand Up @@ -114,7 +114,7 @@ pub struct JPEGDecoder<R> {

num_components: u8,
scan_components: Vec<u8>,
components: VecMap<Component>,
components: HashMap<usize, Component>, // TODO: replace by `VecMap`

mcu_row: Vec<u8>,
mcu: Vec<u8>,
Expand Down Expand Up @@ -150,7 +150,7 @@ impl<R: Read>JPEGDecoder<R> {

num_components: 0,
scan_components: Vec::new(),
components: VecMap::new(),
components: HashMap::new(),

mcu_row: Vec::new(),
mcu: Vec::new(),
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#![warn(unused_qualifications)]
#![deny(missing_copy_implementations)]
#![feature(core)]
#![feature(collections)]
#![feature(std_misc)]
#![feature(rustc_private)]
#![feature(step_by)]
Expand Down
4 changes: 2 additions & 2 deletions src/tga/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ impl<R: Read + Seek> TGADecoder<R> {

for chunk in pixel_data.chunks(self.bytes_per_pixel) {
let index = bytes_to_index(chunk);
result.push_all(color_map.get(index));
result.extend(color_map.get(index).iter().map(|&c| c));
}

result
Expand Down Expand Up @@ -339,7 +339,7 @@ impl<R: Read + Seek> TGADecoder<R> {
let mut data = Vec::with_capacity(self.bytes_per_pixel);
try!(self.r.by_ref().take(self.bytes_per_pixel as u64).read_to_end(&mut data));
for _ in (0usize..repeat_count) {
pixel_data.push_all(&data);
pixel_data.extend(data.iter().map(|&c| c));
}
num_read += repeat_count;
} else {
Expand Down

0 comments on commit 7f5712f

Please sign in to comment.