mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 12:22:34 +00:00
updated cargo fmt
This commit is contained in:
@@ -181,11 +181,11 @@ impl DataMatrixReader {
|
||||
*/
|
||||
fn extractPureBits(&self, image: &BitMatrix) -> Result<BitMatrix> {
|
||||
let Some(leftTopBlack) = image.getTopLeftOnBit() else {
|
||||
return Err(Exceptions::NOT_FOUND)
|
||||
};
|
||||
let Some(rightBottomBlack) = image.getBottomRightOnBit()else {
|
||||
return Err(Exceptions::NOT_FOUND)
|
||||
};
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
};
|
||||
let Some(rightBottomBlack) = image.getBottomRightOnBit() else {
|
||||
return Err(Exceptions::NOT_FOUND);
|
||||
};
|
||||
|
||||
let moduleSize = Self::moduleSize(leftTopBlack, image)?;
|
||||
|
||||
|
||||
@@ -119,9 +119,10 @@ impl Writer for DataMatrixWriter {
|
||||
let hasEncodingHint = hints.contains_key(&EncodeHintType::CHARACTER_SET);
|
||||
if hasEncodingHint {
|
||||
let Some(EncodeHintValue::CharacterSet(char_set_name)) =
|
||||
hints.get(&EncodeHintType::CHARACTER_SET) else {
|
||||
return Err(Exceptions::illegal_argument_with("charset does not exist"))
|
||||
};
|
||||
hints.get(&EncodeHintType::CHARACTER_SET)
|
||||
else {
|
||||
return Err(Exceptions::illegal_argument_with("charset does not exist"));
|
||||
};
|
||||
charset = CharacterSet::get_character_set_by_name(char_set_name);
|
||||
//encoding::label::encoding_from_whatwg_label(char_set_name);
|
||||
// charset = Charset.forName(hints.get(EncodeHintType.CHARACTER_SET).toString());
|
||||
@@ -154,9 +155,16 @@ impl Writer for DataMatrixWriter {
|
||||
}
|
||||
|
||||
let symbol_lookup = SymbolInfoLookup::new();
|
||||
let Some(symbolInfo) = symbol_lookup.lookup_with_codewords_shape_size_fail(encoded.chars().count() as u32, *shape, &minSize, &maxSize, true)? else {
|
||||
return Err(Exceptions::not_found_with("symbol info is bad"))
|
||||
};
|
||||
let Some(symbolInfo) = symbol_lookup.lookup_with_codewords_shape_size_fail(
|
||||
encoded.chars().count() as u32,
|
||||
*shape,
|
||||
&minSize,
|
||||
&maxSize,
|
||||
true,
|
||||
)?
|
||||
else {
|
||||
return Err(Exceptions::not_found_with("symbol info is bad"));
|
||||
};
|
||||
|
||||
//2. step: ECC generation
|
||||
let codewords = error_correction::encodeECC200(&encoded, symbolInfo)?;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
mod cpp_new_detector;
|
||||
|
||||
use crate::common::cpp_essentials::bitmatrix_cursor_trait::*;
|
||||
use crate::common::cpp_essentials::bitmatrix_cursor_trait::*;
|
||||
|
||||
use crate::common::cpp_essentials::dm_regression_line::*;
|
||||
use crate::common::cpp_essentials::edge_tracer::*;
|
||||
use crate::common::cpp_essentials::dm_regression_line::*;
|
||||
use crate::common::cpp_essentials::edge_tracer::*;
|
||||
|
||||
use crate::common::cpp_essentials::util;
|
||||
use crate::common::cpp_essentials::util;
|
||||
|
||||
pub use cpp_new_detector::detect;
|
||||
|
||||
@@ -359,9 +359,7 @@ fn lookAheadTestIntern(msg: &str, startpos: u32, currentMode: u32) -> usize {
|
||||
return C40_ENCODATION;
|
||||
}
|
||||
|
||||
let Some(c) = msg
|
||||
.chars()
|
||||
.nth((startpos + charsProcessed) as usize) else {
|
||||
let Some(c) = msg.chars().nth((startpos + charsProcessed) as usize) else {
|
||||
break 0;
|
||||
};
|
||||
charsProcessed += 1;
|
||||
|
||||
Reference in New Issue
Block a user