From 693d1c25e46b18c1cac9aeafa436c08959c3f486 Mon Sep 17 00:00:00 2001 From: Henry Schimke Date: Sat, 13 Jan 2024 13:56:43 -0600 Subject: [PATCH] chore: convert bitwise is_odd check to is_odd() --- src/common/cpp_essentials/base_extentions/qrcode_version.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/cpp_essentials/base_extentions/qrcode_version.rs b/src/common/cpp_essentials/base_extentions/qrcode_version.rs index 2ba7059..039fbf3 100644 --- a/src/common/cpp_essentials/base_extentions/qrcode_version.rs +++ b/src/common/cpp_essentials/base_extentions/qrcode_version.rs @@ -5,6 +5,8 @@ */ // SPDX-License-Identifier: Apache-2.0 +use num::Integer; + use crate::common::{BitMatrix, Result}; use crate::qrcode::cpp_port::Type; use crate::qrcode::decoder::{ @@ -183,8 +185,8 @@ impl Version { let width = bitMatrix.width() as i32; let height = bitMatrix.height() as i32; if width != height - && (width & 1 != 0) - && (height & 1 != 0) + && width.is_odd() + && height.is_odd() && width >= 27 && width <= 139 && height >= 7