Retry doc upload; Kill some deprecated functions.

This commit is contained in:
kennytm 2015-01-01 22:08:33 +08:00
parent 6756dc10e9
commit 91fdbeac11
4 changed files with 9 additions and 5 deletions

View file

@ -6,4 +6,5 @@ language: rust
after_script:
- cargo doc
- mv target/doc doc
- curl http://www.rust-ci.org/artifacts/put?t=$RUSTCI_TOKEN | sh

View file

@ -3,6 +3,7 @@
//! The `bits` module encodes binary data into raw bits used in a QR code.
use std::cmp::min;
use std::iter::iterate;
#[cfg(test)]
use test::Bencher;
@ -678,8 +679,8 @@ impl Bits {
self.bit_offset = 0;
let data_bytes_length = data_length / 8;
let padding_bytes_count = data_bytes_length - self.data.len();
self.data.grow_fn(padding_bytes_count,
|i| if i % 2 == 0 { 0b11101100 } else { 0b00010001 });
let padding = iterate(0b11101100, |a| a ^ 0b11111101).take(padding_bytes_count);
self.data.extend(padding);
}
if self.len() < data_length {

View file

@ -9,7 +9,7 @@
//! c.apply_mask(MaskPattern::Checkerboard);
//! let bools = c.to_bools();
use std::iter::range_inclusive;
use std::iter::{range_inclusive, repeat};
use std::iter::order::equals;
use std::num::Int;
use std::cmp::max;
@ -102,7 +102,7 @@ impl Canvas {
width: width,
version: version,
ec_level: ec_level,
modules: Vec::from_elem((width*width) as uint, Module::Empty),
modules: repeat(Module::Empty).take((width*width) as uint).collect()
}
}

View file

@ -1,5 +1,7 @@
//! The `ec` module applies the Reed-Solomon error correction codes.
use std::iter::repeat;
use types::{QrResult, Version, EcLevel};
//------------------------------------------------------------------------------
@ -16,7 +18,7 @@ use types::{QrResult, Version, EcLevel};
/// polynomial of degree N.
pub fn create_error_correction_code(data: &[u8], ec_code_size: uint) -> Vec<u8> {
let mut res = data.to_vec();
res.grow(ec_code_size, 0);
res.extend(repeat(0).take(ec_code_size));
let data_len = data.len();
let log_den = GENERATOR_POLYNOMIALS[ec_code_size];