Some standard rust functions are renamed.

This commit is contained in:
kennytm 2014-09-20 17:19:48 +08:00
parent eacaaab721
commit 191796f759
4 changed files with 7 additions and 7 deletions

View file

@ -50,14 +50,14 @@ impl Bits {
self.data.push((number << (16-b)) as u8);
}
(_, 0..8) => {
*self.data.mut_last().unwrap() |= (number << (8-b)) as u8;
*self.data.last_mut().unwrap() |= (number << (8-b)) as u8;
}
(_, 9..16) => {
*self.data.mut_last().unwrap() |= (number >> (b-8)) as u8;
*self.data.last_mut().unwrap() |= (number >> (b-8)) as u8;
self.data.push((number << (16-b)) as u8);
}
_ => {
*self.data.mut_last().unwrap() |= (number >> (b-8)) as u8;
*self.data.last_mut().unwrap() |= (number >> (b-8)) as u8;
self.data.push((number >> (b-16)) as u8);
self.data.push((number << (24-b)) as u8);
}

View file

@ -1483,7 +1483,7 @@ impl Canvas {
|j| self.get(i, j)
};
let mut colors = range(0, self.width).map(map_fn).chain(Some(Empty).move_iter());
let mut colors = range(0, self.width).map(map_fn).chain(Some(Empty).into_iter());
let mut last_color = Empty;
let mut consecutive_len = 1u16;

View file

@ -28,12 +28,12 @@ pub fn create_error_correction_code(data: &[u8], ec_code_size: uint) -> Vec<u8>
}
let log_lead_coeff = LOG_TABLE[lead_coeff] as uint;
for (u, v) in res.mut_slice_from(i+1).mut_iter().zip(log_den.iter()) {
for (u, v) in res.slice_from_mut(i+1).iter_mut().zip(log_den.iter()) {
*u ^= EXP_TABLE[((*v as uint + log_lead_coeff) % 255) as uint];
}
}
res.move_iter().skip(data_len).collect()
res.into_iter().skip(data_len).collect()
}
#[cfg(test)]

View file

@ -153,7 +153,7 @@ impl QrCode {
let width = self.width;
let mut k = 0;
let mut res = String::with_capacity(width * (width + 1));
for i in range(0, width) {
for _ in range(0, width) {
res.push_char('\n');
for _ in range(0, width) {
res.push_char(if self.content[k] { on_char } else { off_char });