mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
cargo clippy --fix
This commit is contained in:
@@ -652,7 +652,7 @@ impl Display for DetectionRXingResult {
|
||||
// try (Formatter formatter = new Formatter()) {
|
||||
for codewordsRow in 0..rowIndicatorColumn.as_ref().unwrap().getCodewords().len() {
|
||||
// for (int codewordsRow = 0; codewordsRow < rowIndicatorColumn.getCodewords().length; codewordsRow++) {
|
||||
write!(f, "CW {0:3}", codewordsRow)?;
|
||||
write!(f, "CW {codewordsRow:3}")?;
|
||||
// formatter.format("CW %3d:", codewordsRow);
|
||||
for barcodeColumn in 0..self.barcodeColumnCount + 2 {
|
||||
// for (int barcodeColumn = 0; barcodeColumn < barcodeColumnCount + 2; barcodeColumn++) {
|
||||
|
||||
@@ -133,7 +133,7 @@ impl Display for DetectionRXingResultColumn {
|
||||
for codeword in &self.codewords {
|
||||
// for (Codeword codeword : codewords) {
|
||||
if codeword.is_none() {
|
||||
writeln!(f, "{:3}: | ", row)?;
|
||||
writeln!(f, "{row:3}: | ")?;
|
||||
row += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -41,8 +41,7 @@ impl TryFrom<&String> for Compaction {
|
||||
}
|
||||
}
|
||||
Err(Exceptions::FormatException(Some(format!(
|
||||
"Compaction must be 0-3 (inclusivie). Found: {}",
|
||||
value
|
||||
"Compaction must be 0-3 (inclusivie). Found: {value}"
|
||||
))))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ impl PDF417 {
|
||||
//4. step: low-level encoding
|
||||
let mut barcode_matrix = BarcodeMatrix::new(rows as usize, cols as usize);
|
||||
self.encodeLowLevel(
|
||||
&format!("{}{}", dataCodewords, ec),
|
||||
&format!("{dataCodewords}{ec}"),
|
||||
cols,
|
||||
rows,
|
||||
errorCorrectionLevel,
|
||||
|
||||
@@ -806,8 +806,7 @@ fn encodingECI(eci: i32, sb: &mut String) -> Result<(), Exceptions> {
|
||||
sb.push(char::from_u32((810900 - eci) as u32).unwrap());
|
||||
} else {
|
||||
return Err(Exceptions::WriterException(Some(format!(
|
||||
"ECI number not in valid range from 0..811799, but was {}",
|
||||
eci
|
||||
"ECI number not in valid range from 0..811799, but was {eci}"
|
||||
))));
|
||||
}
|
||||
Ok(())
|
||||
|
||||
@@ -60,8 +60,7 @@ impl Writer for PDF417Writer {
|
||||
) -> Result<crate::common::BitMatrix, crate::Exceptions> {
|
||||
if format != &BarcodeFormat::PDF_417 {
|
||||
return Err(Exceptions::IllegalArgumentException(Some(format!(
|
||||
"Can only encode PDF_417, but got {}",
|
||||
format
|
||||
"Can only encode PDF_417, but got {format}"
|
||||
))));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user