mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 12:22:34 +00:00
many warnings cleaned up
This commit is contained in:
@@ -19,7 +19,7 @@ use std::{fmt::Display, rc::Rc};
|
||||
use crate::pdf417::pdf_417_common;
|
||||
|
||||
use super::{
|
||||
BarcodeMetadata, BoundingBox, Codeword, DetectionRXingResultColumn,
|
||||
BarcodeMetadata, BoundingBox, Codeword,
|
||||
DetectionRXingResultColumnTrait, DetectionRXingResultRowIndicatorColumn,
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ impl DetectionRXingResult {
|
||||
boundingBox: Rc<BoundingBox>,
|
||||
) -> DetectionRXingResult {
|
||||
let mut columns = Vec::new();
|
||||
for i in 0..(barcodeMetadata.getColumnCount() as usize + 2) {
|
||||
for _i in 0..(barcodeMetadata.getColumnCount() as usize + 2) {
|
||||
columns.push(None);
|
||||
}
|
||||
DetectionRXingResult {
|
||||
|
||||
@@ -14,12 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use std::fmt::Display;
|
||||
|
||||
use crate::{pdf417::pdf_417_common, ResultPoint};
|
||||
|
||||
use super::{
|
||||
BarcodeMetadata, BarcodeValue, BoundingBox, Codeword, DetectionRXingResultColumn,
|
||||
BarcodeMetadata, BarcodeValue, Codeword, DetectionRXingResultColumn,
|
||||
DetectionRXingResultColumnTrait,
|
||||
};
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ pub fn corrupt(received: &mut [u32], howMany: u32, random: &mut rand::rngs::Thre
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn erase(received: &mut [u32], howMany: u32, random: &mut rand::rngs::ThreadRng) -> Vec<u32> {
|
||||
let mut erased = vec![false; received.len()]; //BitSet::new(received.len());
|
||||
let mut erasures = vec![0_u32; howMany as usize];
|
||||
|
||||
@@ -27,7 +27,7 @@ use lazy_static::lazy_static;
|
||||
|
||||
lazy_static! {
|
||||
// static ref PDF417_GF : Rc<&ModulusGF> = Rc::new(&ModulusGF::new(NUMBER_OF_CODEWORDS, 3));
|
||||
static ref fld_interior : ModulusGF = ModulusGF::new(NUMBER_OF_CODEWORDS, 3);
|
||||
static ref FLD_INTERIOR : ModulusGF = ModulusGF::new(NUMBER_OF_CODEWORDS, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ pub fn decode<'a>(
|
||||
numECCodewords: u32,
|
||||
erasures: &mut [u32],
|
||||
) -> Result<usize, Exceptions> {
|
||||
let field: Rc<&'static ModulusGF> = Rc::new(&fld_interior);
|
||||
let field: Rc<&'static ModulusGF> = Rc::new(&FLD_INTERIOR);
|
||||
let poly = ModulusPoly::new(field.clone(), received.to_vec())?;
|
||||
let mut S = vec![0u32; numECCodewords as usize];
|
||||
let mut error = false;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
use rand::Rng;
|
||||
|
||||
use crate::{datamatrix::encoder::error_correction, Exceptions};
|
||||
use crate::{ Exceptions};
|
||||
|
||||
use super::{
|
||||
abstract_error_correction_test_case::{corrupt, getRandom},
|
||||
@@ -56,7 +56,7 @@ fn testNoError() {
|
||||
|
||||
#[test]
|
||||
fn testExplicitError() {
|
||||
let mut random = getRandom();
|
||||
|
||||
for i in 0..PDF417_TEST_WITH_EC.len() {
|
||||
// for (int i = 0; i < PDF417_TEST_WITH_EC.length; i++) {
|
||||
let mut received = PDF417_TEST_WITH_EC.clone();
|
||||
|
||||
@@ -16,12 +16,8 @@
|
||||
|
||||
//public static final ModulusGF PDF417_GF = new ModulusGF(PDF417Common.NUMBER_OF_CODEWORDS, 3);
|
||||
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::Exceptions;
|
||||
|
||||
use super::ModulusPoly;
|
||||
|
||||
/**
|
||||
* <p>A field based on powers of a generator integer, modulo some modulus.</p>
|
||||
*
|
||||
|
||||
@@ -461,7 +461,7 @@ fn encodeDecodeWithAll(
|
||||
|
||||
fn getEndIndex(length: u32, chars: &[char]) -> u32 {
|
||||
let decimalLength: f64 = (chars.len() as f64).log10(); //Math.log10(chars.length);
|
||||
10_f64.powf((decimalLength * length as f64)).ceil() as u32
|
||||
10_f64.powf(decimalLength * length as f64).ceil() as u32
|
||||
// (decimalLength*length as f64).powi(10).ceil() as u32
|
||||
// (decimalLength*length as f64).powi(10).ceil() as u32
|
||||
// Math.ceil(Math.pow(10, decimalLength * length))
|
||||
|
||||
Reference in New Issue
Block a user