diff --git a/src/bits.rs b/src/bits.rs index e7d7738..88094a8 100644 --- a/src/bits.rs +++ b/src/bits.rs @@ -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); } diff --git a/src/canvas.rs b/src/canvas.rs index 94e7826..1386c4c 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -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; diff --git a/src/ec.rs b/src/ec.rs index 37ff8e0..71acf5a 100644 --- a/src/ec.rs +++ b/src/ec.rs @@ -28,12 +28,12 @@ pub fn create_error_correction_code(data: &[u8], ec_code_size: uint) -> Vec } 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)] diff --git a/src/lib.rs b/src/lib.rs index ed35993..b804620 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 });