mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
cleanup more warnings and deprecated function use
This commit is contained in:
@@ -256,9 +256,11 @@ impl CalendarParsedRXingResult {
|
||||
// ? DateFormat.getDateInstance(DateFormat.MEDIUM)
|
||||
// : DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
|
||||
// return format.format(date);
|
||||
NaiveDateTime::from_timestamp(date, 0)
|
||||
.format(format_string)
|
||||
.to_string()
|
||||
if let Some(dtm) = NaiveDateTime::from_timestamp_opt(date, 0) {
|
||||
dtm.format(format_string).to_string()
|
||||
} else {
|
||||
String::from("")
|
||||
}
|
||||
}
|
||||
|
||||
fn parseDurationMS(durationString: &str) -> i64 {
|
||||
|
||||
@@ -250,8 +250,10 @@ fn assertEqualOrNaN(expected: f64, actual: f64) {
|
||||
}
|
||||
|
||||
fn format_date_string(timestamp: i64, format_string: &str) -> String {
|
||||
NaiveDateTime::from_timestamp(timestamp, 0)
|
||||
.format(format_string)
|
||||
.to_string()
|
||||
if let Some(dtm) = NaiveDateTime::from_timestamp_opt(timestamp, 0) {
|
||||
dtm.format(format_string).to_string()
|
||||
} else {
|
||||
String::from("")
|
||||
}
|
||||
// DateTime::from(timestamp,0).with_timezone(Utc).format(format_string).to_string()
|
||||
}
|
||||
|
||||
@@ -36,9 +36,7 @@ use std::collections::HashMap;
|
||||
|
||||
use crate::BarcodeFormat;
|
||||
|
||||
use super::{
|
||||
ExpandedProductParsedRXingResult, ParsedClientResult, ResultParser,
|
||||
};
|
||||
use super::{ExpandedProductParsedRXingResult, ParsedClientResult, ResultParser};
|
||||
|
||||
/**
|
||||
* Parses strings of digits that represent a RSS Extended code.
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
// import java.util.Locale;
|
||||
// import java.util.TimeZone;
|
||||
|
||||
use chrono::{TimeZone, Utc};
|
||||
use chrono::{LocalResult, TimeZone, Utc};
|
||||
|
||||
use crate::{client::result::ParsedRXingResult, BarcodeFormat, RXingResult};
|
||||
|
||||
@@ -500,8 +500,11 @@ fn test_vevent() {
|
||||
}
|
||||
|
||||
fn format_date(year: i32, month: u32, day: u32) -> String {
|
||||
let dtm = Utc.ymd(year, month, day);
|
||||
if let LocalResult::Single(dtm) = Utc.with_ymd_and_hms(year, month, day, 0, 0, 0) {
|
||||
dtm.format("%F").to_string()
|
||||
} else {
|
||||
String::from("")
|
||||
}
|
||||
// Calendar cal = Calendar.getInstance();
|
||||
// cal.clear();
|
||||
// cal.set(year, month - 1, day);
|
||||
@@ -509,8 +512,13 @@ fn format_date(year: i32, month: u32, day: u32) -> String {
|
||||
}
|
||||
|
||||
fn format_time(year: i32, month: u32, day: u32, hour: u32, min: u32, sec: u32) -> String {
|
||||
let dtm = Utc.ymd(year, month, day).and_hms(hour, min, sec);
|
||||
if let LocalResult::Single(dtm) = Utc.with_ymd_and_hms(year, month, day, hour, min, sec) {
|
||||
//Utc.ymd(year, month, day).and_hms(hour, min, sec);
|
||||
|
||||
dtm.format("%c").to_string()
|
||||
} else {
|
||||
String::from("")
|
||||
}
|
||||
// Calendar cal = Calendar.getInstance();
|
||||
// cal.clear();
|
||||
// cal.set(year, month - 1, day, hour, min, sec);
|
||||
|
||||
@@ -81,6 +81,7 @@ impl BitMatrix {
|
||||
// bits = new int[rowSize * height];
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn with_all_data(&self, width: u32, height: u32, rowSize: usize, bits: Vec<u32>) -> Self {
|
||||
Self {
|
||||
width,
|
||||
@@ -168,7 +169,7 @@ impl BitMatrix {
|
||||
if bitsPos > rowStartPos {
|
||||
//if rowLength == -1 {
|
||||
if first_run {
|
||||
first_run = false;
|
||||
// first_run = false;
|
||||
rowLength = bitsPos - rowStartPos;
|
||||
} else if bitsPos - rowStartPos != rowLength {
|
||||
return Err(Exceptions::IllegalArgumentException(
|
||||
|
||||
@@ -224,6 +224,7 @@ impl DefaultPlacement {
|
||||
self.module(1, self.numcols as isize - 1, pos, 8);
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn toBitFieldStringArray(&self) -> Vec<String> {
|
||||
let bits = self.getBits();
|
||||
let numrows = self.getNumrows();
|
||||
|
||||
@@ -20,7 +20,6 @@ use crate::{Dimension, Exceptions};
|
||||
|
||||
use super::{SymbolInfo, SymbolInfoLookup, SymbolShapeHint};
|
||||
use encoding::{self, EncodingRef};
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
|
||||
const ISO_8859_1_ENCODER: EncodingRef = encoding::all::ISO_8859_1;
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ use super::{
|
||||
ASCIIEncoder, Base256Encoder, C40Encoder, EdifactEncoder, Encoder, EncoderContext,
|
||||
SymbolInfoLookup, SymbolShapeHint, TextEncoder, X12Encoder,
|
||||
};
|
||||
#[allow(dead_code)]
|
||||
const DEFAULT_ENCODING: EncodingRef = encoding::all::ISO_8859_1;
|
||||
|
||||
/**
|
||||
|
||||
@@ -354,13 +354,12 @@ impl<'a> SymbolInfoLookup<'a> {
|
||||
}
|
||||
|
||||
mod tests {
|
||||
use crate::{
|
||||
datamatrix::encoder::{SymbolInfo, SymbolShapeHint},
|
||||
Dimension,
|
||||
};
|
||||
|
||||
use crate::{datamatrix::encoder::SymbolShapeHint, Dimension};
|
||||
|
||||
use super::SymbolInfoLookup;
|
||||
|
||||
#[allow(dead_code)]
|
||||
const LOOKUP: SymbolInfoLookup = SymbolInfoLookup::new();
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
use std::{collections::HashSet, path::PathBuf, rc::Rc};
|
||||
|
||||
use crate::{
|
||||
common::HybridBinarizer, BarcodeFormat, BinaryBitmap,
|
||||
BufferedImageLuminanceSource, MultiFormatReader,
|
||||
common::HybridBinarizer, BarcodeFormat, BinaryBitmap, BufferedImageLuminanceSource,
|
||||
MultiFormatReader,
|
||||
};
|
||||
|
||||
use super::{GenericMultipleBarcodeReader, MultipleBarcodeReader};
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
use crate::{
|
||||
common::{BitMatrix},
|
||||
common::BitMatrix,
|
||||
qrcode::detector::{Detector, QRCodeDetectorResult},
|
||||
DecodeHintType, DecodeHintValue, DecodingHintDictionary, Exceptions,
|
||||
};
|
||||
|
||||
@@ -218,11 +218,7 @@ impl Code93Writer {
|
||||
*/
|
||||
#[cfg(test)]
|
||||
mod Code93WriterTestCase {
|
||||
use crate::{
|
||||
common::BitMatrixTestCase,
|
||||
oned::{Code93Writer},
|
||||
BarcodeFormat, Writer,
|
||||
};
|
||||
use crate::{common::BitMatrixTestCase, oned::Code93Writer, BarcodeFormat, Writer};
|
||||
|
||||
#[test]
|
||||
fn testEncode() {
|
||||
|
||||
@@ -22,9 +22,9 @@ use crate::Reader;
|
||||
|
||||
use super::EAN13Reader;
|
||||
use super::EAN8Reader;
|
||||
use super::STAND_IN;
|
||||
use super::UPCAReader;
|
||||
use super::UPCEReader;
|
||||
use super::STAND_IN;
|
||||
use super::{OneDReader, UPCEANReader};
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,44 +24,62 @@
|
||||
* http://www.piramidepse.com/
|
||||
*/
|
||||
|
||||
use crate::oned::rss::expanded::{
|
||||
binary_util,
|
||||
decoders::{abstract_expanded_decoder::createDecoder, AbstractExpandedDecoder},
|
||||
};
|
||||
use crate::oned::rss::expanded::{binary_util, decoders::abstract_expanded_decoder::createDecoder};
|
||||
|
||||
/**
|
||||
* @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
|
||||
*/
|
||||
|
||||
pub const numeric10: &str = "..X..XX";
|
||||
pub const numeric12: &str = "..X.X.X";
|
||||
pub const numeric1FNC1: &str = "..XXX.X";
|
||||
#[allow(dead_code)]
|
||||
pub const NUMERIC10: &str = "..X..XX";
|
||||
#[allow(dead_code)]
|
||||
pub const NUMERIC12: &str = "..X.X.X";
|
||||
#[allow(dead_code)]
|
||||
pub const NUMERIC1_FNC1: &str = "..XXX.X";
|
||||
// static final String numericFNC11 = "XXX.XXX";
|
||||
|
||||
pub const numeric2alpha: &str = "....";
|
||||
#[allow(dead_code)]
|
||||
pub const NUMERIC2ALPHA: &str = "....";
|
||||
|
||||
pub const alphaA: &str = "X.....";
|
||||
pub const alphaFNC1: &str = ".XXXX";
|
||||
pub const alpha2numeric: &str = "...";
|
||||
pub const alpha2isoiec646: &str = "..X..";
|
||||
#[allow(dead_code)]
|
||||
pub const ALPHA_A: &str = "X.....";
|
||||
#[allow(dead_code)]
|
||||
pub const ALPHA_FNC1: &str = ".XXXX";
|
||||
#[allow(dead_code)]
|
||||
pub const ALPHA2NUMERIC: &str = "...";
|
||||
#[allow(dead_code)]
|
||||
pub const ALPHA2ISOIEC646: &str = "..X..";
|
||||
|
||||
pub const i646B: &str = "X.....X";
|
||||
pub const i646C: &str = "X....X.";
|
||||
pub const i646FNC1: &str = ".XXXX";
|
||||
pub const isoiec6462alpha: &str = "..X..";
|
||||
#[allow(dead_code)]
|
||||
pub const I646_B: &str = "X.....X";
|
||||
#[allow(dead_code)]
|
||||
pub const I646_C: &str = "X....X.";
|
||||
#[allow(dead_code)]
|
||||
pub const I646_FNC1: &str = ".XXXX";
|
||||
#[allow(dead_code)]
|
||||
pub const ISOIEC6462ALPHA: &str = "..X..";
|
||||
|
||||
pub const compressedGtin900123456798908: &str = ".........X..XXX.X.X.X...XX.XXXXX.XXXX.X.";
|
||||
pub const compressedGtin900000000000008: &str = "........................................";
|
||||
#[allow(dead_code)]
|
||||
pub const COMPRESSED_GTIN900123456798908: &str = ".........X..XXX.X.X.X...XX.XXXXX.XXXX.X.";
|
||||
#[allow(dead_code)]
|
||||
pub const COMPRESSED_GTIN900000000000008: &str = "........................................";
|
||||
|
||||
pub const compressed15bitWeight1750: &str = "....XX.XX.X.XX.";
|
||||
pub const compressed15bitWeight11750: &str = ".X.XX.XXXX..XX.";
|
||||
pub const compressed15bitWeight0: &str = "...............";
|
||||
#[allow(dead_code)]
|
||||
pub const COMPRESSED15BIT_WEIGHT1750: &str = "....XX.XX.X.XX.";
|
||||
#[allow(dead_code)]
|
||||
pub const COMPRESSED15BIT_WEIGHT11750: &str = ".X.XX.XXXX..XX.";
|
||||
#[allow(dead_code)]
|
||||
pub const COMPRESSED15BIT_WEIGHT0: &str = "...............";
|
||||
|
||||
pub const compressed20bitWeight1750: &str = ".........XX.XX.X.XX.";
|
||||
#[allow(dead_code)]
|
||||
pub const COMPRESSED20BIT_WEIGHT1750: &str = ".........XX.XX.X.XX.";
|
||||
|
||||
pub const compressedDateMarch12th2010: &str = "....XXXX.X..XX..";
|
||||
pub const compressedDateEnd: &str = "X..X.XX.........";
|
||||
#[allow(dead_code)]
|
||||
pub const COMPRESSED_DATE_MARCH12TH2010: &str = "....XXXX.X..XX..";
|
||||
#[allow(dead_code)]
|
||||
pub const COMPRESSED_DATE_END: &str = "X..X.XX.........";
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn assertCorrectBinaryString(binaryString: &str, expectedNumber: &str) {
|
||||
let binary = binary_util::buildBitArrayFromStringWithoutSpaces(binaryString).expect("built");
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ mod AI013103DecoderTest {
|
||||
fn test0131031() {
|
||||
let data = format!(
|
||||
"{}{}{}",
|
||||
HEADER, compressedGtin900123456798908, compressed15bitWeight1750
|
||||
HEADER, COMPRESSED_GTIN900123456798908, COMPRESSED15BIT_WEIGHT1750
|
||||
);
|
||||
let expected = "(01)90012345678908(3103)001750";
|
||||
assertCorrectBinaryString(&data, expected);
|
||||
@@ -94,7 +94,7 @@ mod AI013103DecoderTest {
|
||||
fn test0131032() {
|
||||
let data = format!(
|
||||
"{}{}{}",
|
||||
HEADER, compressedGtin900000000000008, compressed15bitWeight0
|
||||
HEADER, COMPRESSED_GTIN900000000000008, COMPRESSED15BIT_WEIGHT0
|
||||
);
|
||||
let expected = "(01)90000000000003(3103)000000";
|
||||
assertCorrectBinaryString(&data, expected);
|
||||
@@ -105,7 +105,7 @@ mod AI013103DecoderTest {
|
||||
fn test013103invalid() {
|
||||
let data = format!(
|
||||
"{}{}{}..",
|
||||
HEADER, compressedGtin900123456798908, compressed15bitWeight1750
|
||||
HEADER, COMPRESSED_GTIN900123456798908, COMPRESSED15BIT_WEIGHT1750
|
||||
);
|
||||
assertCorrectBinaryString(&data, "");
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ const HEADER: &str = "..X.X";
|
||||
fn test0132021() {
|
||||
let data = format!(
|
||||
"{}{}{}",
|
||||
HEADER, compressedGtin900123456798908, compressed15bitWeight1750
|
||||
HEADER, COMPRESSED_GTIN900123456798908, COMPRESSED15BIT_WEIGHT1750
|
||||
);
|
||||
let expected = "(01)90012345678908(3202)001750";
|
||||
|
||||
@@ -47,7 +47,7 @@ fn test0132021() {
|
||||
fn test0132031() {
|
||||
let data = format!(
|
||||
"{}{}{}",
|
||||
HEADER, compressedGtin900123456798908, compressed15bitWeight11750
|
||||
HEADER, COMPRESSED_GTIN900123456798908, COMPRESSED15BIT_WEIGHT11750
|
||||
);
|
||||
let expected = "(01)90012345678908(3203)001750";
|
||||
|
||||
|
||||
@@ -153,9 +153,9 @@ mod AI013X0X1XDecoderTest {
|
||||
let data = format!(
|
||||
"{}{}{}{}",
|
||||
HEADER310X11,
|
||||
compressedGtin900123456798908,
|
||||
compressed20bitWeight1750,
|
||||
compressedDateEnd
|
||||
COMPRESSED_GTIN900123456798908,
|
||||
COMPRESSED20BIT_WEIGHT1750,
|
||||
COMPRESSED_DATE_END
|
||||
);
|
||||
let expected = "(01)90012345678908(3100)001750";
|
||||
|
||||
@@ -167,9 +167,9 @@ mod AI013X0X1XDecoderTest {
|
||||
let data = format!(
|
||||
"{}{}{}{}",
|
||||
HEADER310X11,
|
||||
compressedGtin900123456798908,
|
||||
compressed20bitWeight1750,
|
||||
compressedDateMarch12th2010
|
||||
COMPRESSED_GTIN900123456798908,
|
||||
COMPRESSED20BIT_WEIGHT1750,
|
||||
COMPRESSED_DATE_MARCH12TH2010
|
||||
);
|
||||
let expected = "(01)90012345678908(3100)001750(11)100312";
|
||||
|
||||
@@ -181,9 +181,9 @@ mod AI013X0X1XDecoderTest {
|
||||
let data = format!(
|
||||
"{}{}{}{}",
|
||||
HEADER320X11,
|
||||
compressedGtin900123456798908,
|
||||
compressed20bitWeight1750,
|
||||
compressedDateMarch12th2010
|
||||
COMPRESSED_GTIN900123456798908,
|
||||
COMPRESSED20BIT_WEIGHT1750,
|
||||
COMPRESSED_DATE_MARCH12TH2010
|
||||
);
|
||||
let expected = "(01)90012345678908(3200)001750(11)100312";
|
||||
|
||||
@@ -195,9 +195,9 @@ mod AI013X0X1XDecoderTest {
|
||||
let data = format!(
|
||||
"{}{}{}{}",
|
||||
HEADER310X13,
|
||||
compressedGtin900123456798908,
|
||||
compressed20bitWeight1750,
|
||||
compressedDateMarch12th2010
|
||||
COMPRESSED_GTIN900123456798908,
|
||||
COMPRESSED20BIT_WEIGHT1750,
|
||||
COMPRESSED_DATE_MARCH12TH2010
|
||||
);
|
||||
let expected = "(01)90012345678908(3100)001750(13)100312";
|
||||
|
||||
@@ -209,9 +209,9 @@ mod AI013X0X1XDecoderTest {
|
||||
let data = format!(
|
||||
"{}{}{}{}",
|
||||
HEADER320X13,
|
||||
compressedGtin900123456798908,
|
||||
compressed20bitWeight1750,
|
||||
compressedDateMarch12th2010
|
||||
COMPRESSED_GTIN900123456798908,
|
||||
COMPRESSED20BIT_WEIGHT1750,
|
||||
COMPRESSED_DATE_MARCH12TH2010
|
||||
);
|
||||
let expected = "(01)90012345678908(3200)001750(13)100312";
|
||||
|
||||
@@ -223,9 +223,9 @@ mod AI013X0X1XDecoderTest {
|
||||
let data = format!(
|
||||
"{}{}{}{}",
|
||||
HEADER310X15,
|
||||
compressedGtin900123456798908,
|
||||
compressed20bitWeight1750,
|
||||
compressedDateMarch12th2010
|
||||
COMPRESSED_GTIN900123456798908,
|
||||
COMPRESSED20BIT_WEIGHT1750,
|
||||
COMPRESSED_DATE_MARCH12TH2010
|
||||
);
|
||||
let expected = "(01)90012345678908(3100)001750(15)100312";
|
||||
|
||||
@@ -237,9 +237,9 @@ mod AI013X0X1XDecoderTest {
|
||||
let data = format!(
|
||||
"{}{}{}{}",
|
||||
HEADER320X15,
|
||||
compressedGtin900123456798908,
|
||||
compressed20bitWeight1750,
|
||||
compressedDateMarch12th2010
|
||||
COMPRESSED_GTIN900123456798908,
|
||||
COMPRESSED20BIT_WEIGHT1750,
|
||||
COMPRESSED_DATE_MARCH12TH2010
|
||||
);
|
||||
let expected = "(01)90012345678908(3200)001750(15)100312";
|
||||
|
||||
@@ -251,9 +251,9 @@ mod AI013X0X1XDecoderTest {
|
||||
let data = format!(
|
||||
"{}{}{}{}",
|
||||
HEADER310X17,
|
||||
compressedGtin900123456798908,
|
||||
compressed20bitWeight1750,
|
||||
compressedDateMarch12th2010
|
||||
COMPRESSED_GTIN900123456798908,
|
||||
COMPRESSED20BIT_WEIGHT1750,
|
||||
COMPRESSED_DATE_MARCH12TH2010
|
||||
);
|
||||
let expected = "(01)90012345678908(3100)001750(17)100312";
|
||||
|
||||
@@ -265,9 +265,9 @@ mod AI013X0X1XDecoderTest {
|
||||
let data = format!(
|
||||
"{}{}{}{}",
|
||||
HEADER320X17,
|
||||
compressedGtin900123456798908,
|
||||
compressed20bitWeight1750,
|
||||
compressedDateMarch12th2010
|
||||
COMPRESSED_GTIN900123456798908,
|
||||
COMPRESSED20BIT_WEIGHT1750,
|
||||
COMPRESSED_DATE_MARCH12TH2010
|
||||
);
|
||||
let expected = "(01)90012345678908(3200)001750(17)100312";
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ mod AnyAIDecoderTest {
|
||||
fn testAnyAIDecoder1() {
|
||||
let data = format!(
|
||||
"{}{}{}{}{}{}{}",
|
||||
HEADER, numeric10, numeric12, numeric2alpha, alphaA, alpha2numeric, numeric12
|
||||
HEADER, NUMERIC10, NUMERIC12, NUMERIC2ALPHA, ALPHA_A, ALPHA2NUMERIC, NUMERIC12
|
||||
);
|
||||
let expected = "(10)12A12";
|
||||
|
||||
@@ -82,7 +82,7 @@ mod AnyAIDecoderTest {
|
||||
fn testAnyAIDecoder2() {
|
||||
let data = format!(
|
||||
"{}{}{}{}{}{}{}",
|
||||
HEADER, numeric10, numeric12, numeric2alpha, alphaA, alpha2isoiec646, i646B
|
||||
HEADER, NUMERIC10, NUMERIC12, NUMERIC2ALPHA, ALPHA_A, ALPHA2ISOIEC646, I646_B
|
||||
);
|
||||
let expected = "(10)12AB";
|
||||
|
||||
@@ -94,15 +94,15 @@ mod AnyAIDecoderTest {
|
||||
let data = format!(
|
||||
"{}{}{}{}{}{}{}{}{}{}",
|
||||
HEADER,
|
||||
numeric10,
|
||||
numeric2alpha,
|
||||
alpha2isoiec646,
|
||||
i646B,
|
||||
i646C,
|
||||
isoiec6462alpha,
|
||||
alphaA,
|
||||
alpha2numeric,
|
||||
numeric10
|
||||
NUMERIC10,
|
||||
NUMERIC2ALPHA,
|
||||
ALPHA2ISOIEC646,
|
||||
I646_B,
|
||||
I646_C,
|
||||
ISOIEC6462ALPHA,
|
||||
ALPHA_A,
|
||||
ALPHA2NUMERIC,
|
||||
NUMERIC10
|
||||
);
|
||||
let expected = "(10)BCA10";
|
||||
|
||||
@@ -111,7 +111,7 @@ mod AnyAIDecoderTest {
|
||||
|
||||
#[test]
|
||||
fn testAnyAIDecodernumericFNC1secondDigit() {
|
||||
let data = format!("{}{}{}", HEADER, numeric10, numeric1FNC1);
|
||||
let data = format!("{}{}{}", HEADER, NUMERIC10, NUMERIC1_FNC1);
|
||||
let expected = "(10)1";
|
||||
|
||||
assertCorrectBinaryString(&data, expected);
|
||||
@@ -121,7 +121,7 @@ mod AnyAIDecoderTest {
|
||||
fn testAnyAIDecoderalphaFNC1() {
|
||||
let data = format!(
|
||||
"{}{}{}{}{}",
|
||||
HEADER, numeric10, numeric2alpha, alphaA, alphaFNC1
|
||||
HEADER, NUMERIC10, NUMERIC2ALPHA, ALPHA_A, ALPHA_FNC1
|
||||
);
|
||||
let expected = "(10)A";
|
||||
|
||||
@@ -132,7 +132,7 @@ mod AnyAIDecoderTest {
|
||||
fn testAnyAIDecoder646FNC1() {
|
||||
let data = format!(
|
||||
"{}{}{}{}{}{}{}",
|
||||
HEADER, numeric10, numeric2alpha, alphaA, isoiec6462alpha, i646B, i646FNC1
|
||||
HEADER, NUMERIC10, NUMERIC2ALPHA, ALPHA_A, ISOIEC6462ALPHA, I646_B, I646_FNC1
|
||||
);
|
||||
let expected = "(10)AB";
|
||||
|
||||
|
||||
@@ -48,7 +48,9 @@ impl DecodedNumeric {
|
||||
pub fn new(newPosition: usize, firstDigit: u32, secondDigit: u32) -> Result<Self, Exceptions> {
|
||||
// super(newPosition);
|
||||
|
||||
if /*firstDigit < 0 ||*/ firstDigit > 10 || /*secondDigit < 0 ||*/ secondDigit > 10 {
|
||||
if
|
||||
/*firstDigit < 0 ||*/
|
||||
firstDigit > 10 || /*secondDigit < 0 ||*/ secondDigit > 10 {
|
||||
return Err(Exceptions::FormatException(
|
||||
".getFormatInstance();".to_owned(),
|
||||
));
|
||||
|
||||
@@ -23,18 +23,16 @@
|
||||
*
|
||||
* http://www.piramidepse.com/
|
||||
*/
|
||||
|
||||
/**
|
||||
* @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
|
||||
* @author Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es)
|
||||
*/
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::Exceptions;
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
|
||||
/**
|
||||
* @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
|
||||
* @author Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es)
|
||||
*/
|
||||
|
||||
lazy_static! {
|
||||
|
||||
static ref TWO_DIGIT_DATA_LENGTH : HashMap<String,DataLength> = {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::{
|
||||
common::{detector::MathUtils, BitArray},
|
||||
common::BitArray,
|
||||
oned::{
|
||||
recordPattern, recordPatternInReverse,
|
||||
rss::{
|
||||
@@ -287,6 +287,7 @@ impl RSSExpandedReader {
|
||||
[45, 135, 194, 160, 58, 174, 100, 89],
|
||||
];
|
||||
|
||||
#[allow(dead_code)]
|
||||
const MAX_PAIRS: usize = 11;
|
||||
|
||||
// Not private for testing
|
||||
@@ -536,6 +537,7 @@ impl RSSExpandedReader {
|
||||
|
||||
// Only used for unit testing
|
||||
#[cfg(test)]
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn getRowsMut(&mut self) -> &mut [ExpandedRow] {
|
||||
&mut self.rows
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::{
|
||||
common::{detector::MathUtils, BitArray},
|
||||
common::BitArray,
|
||||
oned::{one_d_reader, OneDReader},
|
||||
BarcodeFormat, DecodeHintType, DecodingHintDictionary, Exceptions, RXingResult,
|
||||
RXingResultMetadataType, RXingResultMetadataValue, RXingResultPoint, Reader, ResultPoint,
|
||||
@@ -250,7 +250,7 @@ impl RSS14Reader {
|
||||
row: &BitArray,
|
||||
right: bool,
|
||||
rowNumber: u32,
|
||||
hints: &DecodingHintDictionary,
|
||||
_hints: &DecodingHintDictionary,
|
||||
) -> Option<Pair> {
|
||||
let pos_pair = || -> Result<Pair, Exceptions> {
|
||||
let startEnd = self.findFinderPattern(row, right)?;
|
||||
|
||||
@@ -21,7 +21,7 @@ use crate::{
|
||||
RXingResultMetadataValue, RXingResultPoint,
|
||||
};
|
||||
|
||||
use super::{upc_ean_reader, STAND_IN, UPCEANReader};
|
||||
use super::{upc_ean_reader, UPCEANReader, STAND_IN};
|
||||
|
||||
/**
|
||||
* @see UPCEANExtension5Support
|
||||
|
||||
@@ -21,7 +21,7 @@ use crate::{
|
||||
RXingResultMetadataValue, RXingResultPoint,
|
||||
};
|
||||
|
||||
use super::{upc_ean_reader, STAND_IN, UPCEANReader};
|
||||
use super::{upc_ean_reader, UPCEANReader, STAND_IN};
|
||||
|
||||
/**
|
||||
* @see UPCEANExtension2Support
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
use crate::{common::BitArray, Exceptions, RXingResult};
|
||||
|
||||
use super::{STAND_IN, UPCEANExtension2Support, UPCEANExtension5Support, UPCEANReader};
|
||||
use super::{UPCEANExtension2Support, UPCEANExtension5Support, UPCEANReader, STAND_IN};
|
||||
|
||||
pub struct UPCEANExtensionSupport {
|
||||
twoSupport: UPCEANExtension2Support,
|
||||
|
||||
@@ -19,8 +19,8 @@ use std::{fmt::Display, rc::Rc};
|
||||
use crate::pdf417::pdf_417_common;
|
||||
|
||||
use super::{
|
||||
BarcodeMetadata, BoundingBox, Codeword,
|
||||
DetectionRXingResultColumnTrait, DetectionRXingResultRowIndicatorColumn,
|
||||
BarcodeMetadata, BoundingBox, Codeword, DetectionRXingResultColumnTrait,
|
||||
DetectionRXingResultRowIndicatorColumn,
|
||||
};
|
||||
|
||||
const ADJUST_ROW_NUMBER_SKIP: u32 = 2;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
use rand::Rng;
|
||||
|
||||
use crate::{ Exceptions};
|
||||
use crate::Exceptions;
|
||||
|
||||
use super::{
|
||||
abstract_error_correction_test_case::{corrupt, getRandom},
|
||||
@@ -56,7 +56,6 @@ fn testNoError() {
|
||||
|
||||
#[test]
|
||||
fn testExplicitError() {
|
||||
|
||||
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();
|
||||
|
||||
@@ -9,8 +9,6 @@ mod mode;
|
||||
mod qr_code_decoder_meta_data;
|
||||
mod version;
|
||||
|
||||
#[cfg(test)]
|
||||
mod data_mask_testcase;
|
||||
#[cfg(test)]
|
||||
mod DecodedBitStreamParserTestCase;
|
||||
#[cfg(test)]
|
||||
@@ -21,6 +19,8 @@ mod FormatInformationTestCase;
|
||||
mod ModeTestCase;
|
||||
#[cfg(test)]
|
||||
mod VersionTestCase;
|
||||
#[cfg(test)]
|
||||
mod data_mask_testcase;
|
||||
|
||||
pub use bit_matrix_parser::*;
|
||||
pub use data_block::*;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* @author satorux@google.com (Satoru Takabayashi) - creator
|
||||
* @author dswitkin@google.com (Daniel Switkin) - ported from C++
|
||||
*/
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
use encoding::EncodingRef;
|
||||
|
||||
@@ -11,13 +11,13 @@ pub use byte_matrix::*;
|
||||
pub use minimal_encoder::*;
|
||||
pub use qr_code::*;
|
||||
|
||||
#[cfg(test)]
|
||||
mod bit_vector_testcase;
|
||||
#[cfg(test)]
|
||||
mod EncoderTestCase;
|
||||
#[cfg(test)]
|
||||
mod MaskUtilTestCase;
|
||||
#[cfg(test)]
|
||||
mod matrix_util_testcase;
|
||||
#[cfg(test)]
|
||||
mod QRCodeTestCase;
|
||||
#[cfg(test)]
|
||||
mod bit_vector_testcase;
|
||||
#[cfg(test)]
|
||||
mod matrix_util_testcase;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
//package com.google.zxing;
|
||||
|
||||
use std::{ rc::Rc};
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::pdf417::PDF417RXingResultMetadata;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use rxing::{MultiFormatReader};
|
||||
use rxing::MultiFormatReader;
|
||||
|
||||
mod common;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user