mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
more minimal encoder functions pass
This commit is contained in:
@@ -557,7 +557,7 @@ fn encodeHighLevel(msg: &str) -> String {
|
||||
fn encodeHighLevelCompare(msg: &str, compareSizeToMinimalEncoder: bool) -> String {
|
||||
let encoded = high_level_encoder::encodeHighLevel(msg).expect("encodes");
|
||||
let encoded2 = minimal_encoder::encodeHighLevel(msg).expect("encodes");
|
||||
assert!(!compareSizeToMinimalEncoder || encoded2.len() <= encoded.len(), "{} <= {}", encoded2.len() , encoded.len());
|
||||
assert!(!compareSizeToMinimalEncoder || encoded2.chars().count() <= encoded.chars().count(), "{} <= {}", encoded2.chars().count() , encoded.chars().count());
|
||||
visualize(&encoded)
|
||||
}
|
||||
|
||||
|
||||
@@ -1017,7 +1017,7 @@ impl Edge {
|
||||
assert!(self.characterLength % 3 == 0);
|
||||
let mut result = vec![0u8; self.characterLength as usize / 3 * 2];
|
||||
let mut i = 0;
|
||||
while i <= result.len() {
|
||||
while i < result.len() {
|
||||
// for (int i = 0; i < result.length; i += 2) {
|
||||
Self::setC40Word(
|
||||
&mut result,
|
||||
@@ -1322,7 +1322,8 @@ impl RXingResult {
|
||||
randomizeLengths.push(size);
|
||||
}
|
||||
if Edge::getPreviousStartMode(current.previous.clone()) != current.getMode() {
|
||||
Self::prepend(¤t.getLatchBytes()?, &mut bytesAL);}
|
||||
Self::prepend(¤t.getLatchBytes()?, &mut bytesAL);
|
||||
}
|
||||
size = 0;
|
||||
}
|
||||
|
||||
@@ -1450,7 +1451,7 @@ impl Input {
|
||||
pub fn getFNC1Character(&self) -> Option<char> {
|
||||
if self.internal.getFNC1Character() == 1000 {
|
||||
None
|
||||
}else {
|
||||
} else {
|
||||
Some(self.internal.getFNC1Character() as u8 as char)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user