clippy --fix && fmt

This commit is contained in:
Henry Schimke
2023-03-04 14:17:56 -06:00
parent 8a0744e534
commit 69c0119c94
11 changed files with 64 additions and 68 deletions

View File

@@ -19,7 +19,7 @@ use num::{self, bigint::ToBigUint, BigUint};
use std::rc::Rc;
use crate::{
common::{DecoderRXingResult, ECIStringBuilder, Result, Eci},
common::{DecoderRXingResult, ECIStringBuilder, Eci, Result},
pdf417::PDF417RXingResultMetadata,
Exceptions,
};

View File

@@ -21,7 +21,7 @@
use std::{any::TypeId, fmt::Display, str::FromStr};
use crate::{
common::{CharacterSet, ECIInput, MinimalECIInput, Result, Eci},
common::{CharacterSet, ECIInput, Eci, MinimalECIInput, Result},
Exceptions,
};
@@ -802,7 +802,7 @@ fn encodingECI(eci: Eci, sb: &mut String) -> Result<()> {
if (0..900).contains(&(eci as i32)) {
sb.push(char::from_u32(ECI_CHARSET).ok_or(Exceptions::PARSE)?);
sb.push(char::from_u32(eci as u32).ok_or(Exceptions::PARSE)?);
} else if (eci as i32 )< 810900 {
} else if (eci as i32) < 810900 {
sb.push(char::from_u32(ECI_GENERAL_PURPOSE).ok_or(Exceptions::PARSE)?);
sb.push(char::from_u32(((eci as i32) / 900 - 1) as u32).ok_or(Exceptions::PARSE)?);
sb.push(char::from_u32(((eci as i32) % 900) as u32).ok_or(Exceptions::PARSE)?);
@@ -908,13 +908,8 @@ mod PDF417EncoderTestCase {
#[test]
fn testEncodeNumeric() {
let encoded = encodeHighLevel(
"1234",
Compaction::NUMERIC,
Some(CharacterSet::UTF8),
false,
)
.expect("encode");
let encoded = encodeHighLevel("1234", Compaction::NUMERIC, Some(CharacterSet::UTF8), false)
.expect("encode");
assert_eq!("\u{039f}\u{001A}\u{0386}\u{C}\u{01b2}", encoded);
// converted \f to \u{0046}
}