This commit is contained in:
kennytm 2015-02-21 19:30:12 +08:00
parent 068707d312
commit da775325ed
2 changed files with 3 additions and 3 deletions

View file

@ -843,8 +843,8 @@ pub fn encode_auto(data: &[u8], ec_level: EcLevel) -> QrResult<Bits> {
/// in the given error correction level. /// in the given error correction level.
#[unstable] #[unstable]
fn find_min_version(length: usize, ec_level: EcLevel) -> Version { fn find_min_version(length: usize, ec_level: EcLevel) -> Version {
let mut min = 0us; let mut min = 0;
let mut max = 39us; let mut max = 39;
while min < max { while min < max {
let half = (min + max) / 2; let half = (min + max) / 2;
if DATA_LENGTHS[half][ec_level as usize] < length { if DATA_LENGTHS[half][ec_level as usize] < length {

View file

@ -1278,7 +1278,7 @@ impl Canvas {
for (i, b) in codewords.iter().enumerate() { for (i, b) in codewords.iter().enumerate() {
let bits_end = if i == last_word { 4 } else { 0 }; let bits_end = if i == last_word { 4 } else { 0 };
'outside: 'outside:
for j in range_inclusive(bits_end, 7us).rev() { for j in range_inclusive(bits_end, 7).rev() {
let color = if (*b & (1 << j)) != 0 { let color = if (*b & (1 << j)) != 0 {
Module::DarkUnmasked Module::DarkUnmasked
} else { } else {