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:
@@ -32,14 +32,14 @@ fn testMask0() {
|
||||
|
||||
#[test]
|
||||
fn testMask1() {
|
||||
testMaskAcrossDimensions(DataMask::DATA_MASK_001, |i, j| i % 2 == 0);
|
||||
testMaskAcrossDimensionsU8(1, |i, j| i % 2 == 0);
|
||||
testMaskAcrossDimensions(DataMask::DATA_MASK_001, |i, _j| i % 2 == 0);
|
||||
testMaskAcrossDimensionsU8(1, |i, _j| i % 2 == 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn testMask2() {
|
||||
testMaskAcrossDimensions(DataMask::DATA_MASK_010, |i, j| j % 3 == 0);
|
||||
testMaskAcrossDimensionsU8(2, |i, j| j % 3 == 0);
|
||||
testMaskAcrossDimensions(DataMask::DATA_MASK_010, |_i, j| j % 3 == 0);
|
||||
testMaskAcrossDimensionsU8(2, |_i, j| j % 3 == 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -10,7 +10,7 @@ mod qr_code_decoder_meta_data;
|
||||
mod version;
|
||||
|
||||
#[cfg(test)]
|
||||
mod DataMaskTestCase;
|
||||
mod data_mask_testcase;
|
||||
#[cfg(test)]
|
||||
mod DecodedBitStreamParserTestCase;
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -40,6 +40,7 @@ fn test_encode_decode(value: &str) {
|
||||
}
|
||||
|
||||
// Zooms a bit matrix so that each bit is factor x factor
|
||||
#[allow(dead_code)]
|
||||
fn make_larger(input: &BitMatrix, factor: u32) -> BitMatrix {
|
||||
let width = input.getWidth();
|
||||
let mut output = BitMatrix::with_single_dimension(width * factor);
|
||||
@@ -15,4 +15,4 @@ pub use finder_pattern_info::*;
|
||||
pub use qrcode_detector_result::*;
|
||||
|
||||
#[cfg(test)]
|
||||
mod DetectorTest;
|
||||
mod cetector_test;
|
||||
|
||||
@@ -128,7 +128,7 @@ fn testXOR() {
|
||||
v1.appendBits(0x5555aaaa, 32).expect("append");
|
||||
let mut v2 = BitArray::new();
|
||||
v2.appendBits(0xaaaa5555, 32).expect("append");
|
||||
v1.xor(&v2);
|
||||
v1.xor(&v2).expect("xor");
|
||||
assert_eq!(0xffffffff, getUnsignedInt(&v1));
|
||||
}
|
||||
|
||||
@@ -137,8 +137,8 @@ fn testXOR2() {
|
||||
let mut v1 = BitArray::new();
|
||||
v1.appendBits(0x2a, 7).expect("append"); // 010 1010
|
||||
let mut v2 = BitArray::new();
|
||||
v2.appendBits(0x55, 7); // 101 0101
|
||||
v1.xor(&v2);
|
||||
v2.appendBits(0x55, 7).expect("append"); // 101 0101
|
||||
v1.xor(&v2).expect("xor");
|
||||
assert_eq!(0xfe000000, getUnsignedInt(&v1)); // 1111 1110
|
||||
}
|
||||
|
||||
@@ -13,25 +13,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// package com.google.zxing.qrcode.encoder;
|
||||
|
||||
// import com.google.zxing.EncodeHintType;
|
||||
// import com.google.zxing.WriterException;
|
||||
// import com.google.zxing.common.BitArray;
|
||||
// import com.google.zxing.common.StringUtils;
|
||||
// import com.google.zxing.common.CharacterSetECI;
|
||||
// import com.google.zxing.common.reedsolomon.GenericGF;
|
||||
// import com.google.zxing.common.reedsolomon.ReedSolomonEncoder;
|
||||
// import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
|
||||
// import com.google.zxing.qrcode.decoder.Mode;
|
||||
// import com.google.zxing.qrcode.decoder.Version;
|
||||
|
||||
// import java.nio.charset.Charset;
|
||||
// import java.nio.charset.StandardCharsets;
|
||||
// import java.util.ArrayList;
|
||||
// import java.util.Collection;
|
||||
// import java.util.Map;
|
||||
/**
|
||||
* @author satorux@google.com (Satoru Takabayashi) - creator
|
||||
* @author dswitkin@google.com (Daniel Switkin) - ported from C++
|
||||
*/
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
@@ -51,11 +36,6 @@ use crate::{
|
||||
|
||||
use super::{mask_util, matrix_util, BlockPair, ByteMatrix, MinimalEncoder, QRCode};
|
||||
|
||||
/**
|
||||
* @author satorux@google.com (Satoru Takabayashi) - creator
|
||||
* @author dswitkin@google.com (Daniel Switkin) - ported from C++
|
||||
*/
|
||||
|
||||
lazy_static! {
|
||||
static ref SHIFT_JIS_CHARSET: EncodingRef =
|
||||
encoding::label::encoding_from_whatwg_label("SJIS").unwrap();
|
||||
|
||||
@@ -245,7 +245,7 @@ fn testBuildMatrix() {
|
||||
let mut bits = BitArray::new();
|
||||
for c in bytes {
|
||||
// for (char c: bytes) {
|
||||
bits.appendBits(c, 8);
|
||||
bits.appendBits(c, 8).expect("append");
|
||||
}
|
||||
let mut matrix = ByteMatrix::new(21, 21);
|
||||
matrix_util::buildMatrix(
|
||||
@@ -616,8 +616,8 @@ pub struct Edge {
|
||||
characterLength: u32,
|
||||
previous: Option<Rc<Edge>>,
|
||||
cachedTotalSize: u32,
|
||||
encoders: ECIEncoderSet,
|
||||
stringToEncode: Vec<String>,
|
||||
_encoders: ECIEncoderSet,
|
||||
_stringToEncode: Vec<String>,
|
||||
}
|
||||
impl Edge {
|
||||
pub fn new(
|
||||
@@ -641,7 +641,7 @@ impl Edge {
|
||||
charsetEncoderIndex: nci,
|
||||
characterLength,
|
||||
previous: previous.clone(),
|
||||
stringToEncode: stringToEncode.clone(),
|
||||
_stringToEncode: stringToEncode.clone(),
|
||||
cachedTotalSize: {
|
||||
let mut size = if previous.is_some() {
|
||||
previous.as_ref().unwrap().cachedTotalSize
|
||||
@@ -713,7 +713,7 @@ impl Edge {
|
||||
// }
|
||||
size
|
||||
},
|
||||
encoders,
|
||||
_encoders : encoders,
|
||||
}
|
||||
// this.mode = mode;
|
||||
// this.fromPosition = fromPosition;
|
||||
|
||||
@@ -12,12 +12,12 @@ pub use minimal_encoder::*;
|
||||
pub use qr_code::*;
|
||||
|
||||
#[cfg(test)]
|
||||
mod BitVectorTestCase;
|
||||
mod bit_vector_testcase;
|
||||
#[cfg(test)]
|
||||
mod EncoderTestCase;
|
||||
#[cfg(test)]
|
||||
mod MaskUtilTestCase;
|
||||
#[cfg(test)]
|
||||
mod MatrixUtilTestCase;
|
||||
mod matrix_util_testcase;
|
||||
#[cfg(test)]
|
||||
mod QRCodeTestCase;
|
||||
|
||||
Reference in New Issue
Block a user