chore: convert bitwise is_odd check to is_odd()

This commit is contained in:
Henry Schimke
2024-01-13 13:56:43 -06:00
parent 86689a87d9
commit 693d1c25e4

View File

@@ -5,6 +5,8 @@
*/ */
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
use num::Integer;
use crate::common::{BitMatrix, Result}; use crate::common::{BitMatrix, Result};
use crate::qrcode::cpp_port::Type; use crate::qrcode::cpp_port::Type;
use crate::qrcode::decoder::{ use crate::qrcode::decoder::{
@@ -183,8 +185,8 @@ impl Version {
let width = bitMatrix.width() as i32; let width = bitMatrix.width() as i32;
let height = bitMatrix.height() as i32; let height = bitMatrix.height() as i32;
if width != height if width != height
&& (width & 1 != 0) && width.is_odd()
&& (height & 1 != 0) && height.is_odd()
&& width >= 27 && width >= 27
&& width <= 139 && width <= 139
&& height >= 7 && height >= 7