diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 01583d9..291411c 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -283,7 +283,7 @@ impl QrCode { /// A mid-level API is the `encode_segments()` function. pub fn encode_codewords(ver: Version, ecl: QrCodeEcc, datacodewords: &[u8], mut mask: Option) -> Self { // Initialize fields - let size: usize = usize::from(ver.value()) * 4 + 17; + let size = usize::from(ver.value()) * 4 + 17; let mut result = Self { version: ver, size: size as i32, @@ -729,7 +729,7 @@ impl QrCode { if ver == 1 { vec![] } else { - let numalign: i32 = i32::from(ver) / 7 + 2; + let numalign = i32::from(ver) / 7 + 2; let step: i32 = if ver == 32 { 26 } else {(i32::from(ver)*4 + numalign*2 + 1) / (numalign*2 - 2) * 2}; let mut result: Vec = (0 .. numalign - 1).map(