diff --git a/python/qrcodegen.py b/python/qrcodegen.py index 3304cd3..a563aed 100644 --- a/python/qrcodegen.py +++ b/python/qrcodegen.py @@ -200,9 +200,9 @@ class QrCode: minpenalty = penalty self._apply_mask(i) # Undoes the mask due to XOR assert 0 <= mask <= 7 + self._mask = mask self._apply_mask(mask) # Apply the final choice of mask self._draw_format_bits(mask) # Overwrite old format bits - self._mask = mask del self._isfunction diff --git a/rust/src/lib.rs b/rust/src/lib.rs index a2ee375..32d0809 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -210,8 +210,7 @@ impl QrCode { // Find the minimal version number to use let mut version: Version = minversion; let datausedbits: usize = loop { - // Number of data bits available - let datacapacitybits: usize = QrCode::get_num_data_codewords(version, ecl) * 8; + let datacapacitybits: usize = QrCode::get_num_data_codewords(version, ecl) * 8; // Number of data bits available let dataused: Option = QrSegment::get_total_bits(segs, version); if dataused.map_or(false, |n| n <= datacapacitybits) { break dataused.unwrap(); // This version number is found to be suitable