mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 12:22:34 +00:00
cargo clippy --fix
This commit is contained in:
@@ -37,8 +37,7 @@ impl BitMatrixParser {
|
||||
let dimension = bit_matrix.getHeight();
|
||||
if dimension < 21 || (dimension & 0x03) != 1 {
|
||||
Err(Exceptions::FormatException(Some(format!(
|
||||
"{} < 21 || ({} % 0x03) != 1",
|
||||
dimension, dimension
|
||||
"{dimension} < 21 || ({dimension} % 0x03) != 1"
|
||||
))))
|
||||
} else {
|
||||
Ok(Self {
|
||||
|
||||
@@ -231,8 +231,7 @@ impl TryFrom<u8> for DataMask {
|
||||
6 => Ok(DataMask::DATA_MASK_110),
|
||||
7 => Ok(DataMask::DATA_MASK_111),
|
||||
_ => Err(Exceptions::IllegalArgumentException(Some(format!(
|
||||
"{} is not between 0 and 7",
|
||||
value
|
||||
"{value} is not between 0 and 7"
|
||||
)))),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ fn testMask(mask: DataMask, dimension: u32, condition: MaskCondition) {
|
||||
// for (int i = 0; i < dimension; i++) {
|
||||
for j in 0..dimension {
|
||||
// for (int j = 0; j < dimension; j++) {
|
||||
assert_eq!(condition(i, j), bits.get(j, i), "({},{})", i, j);
|
||||
assert_eq!(condition(i, j), bits.get(j, i), "({i},{j})");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,8 +96,7 @@ pub fn decode(
|
||||
currentCharacterSetECI = Some(CharacterSetECI::getCharacterSetECIByValue(value)?);
|
||||
if currentCharacterSetECI.is_none() {
|
||||
return Err(Exceptions::FormatException(Some(format!(
|
||||
"Value of {} not valid",
|
||||
value
|
||||
"Value of {value} not valid"
|
||||
))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,8 +48,7 @@ impl ErrorCorrectionLevel {
|
||||
2 => Ok(Self::H),
|
||||
3 => Ok(Self::Q),
|
||||
_ => Err(Exceptions::IllegalArgumentException(Some(format!(
|
||||
"{} is not a valid bit selection",
|
||||
bits
|
||||
"{bits} is not a valid bit selection"
|
||||
)))),
|
||||
}
|
||||
}
|
||||
@@ -111,8 +110,7 @@ impl FromStr for ErrorCorrectionLevel {
|
||||
}
|
||||
|
||||
return Err(Exceptions::IllegalArgumentException(Some(format!(
|
||||
"could not parse {} into an ec level",
|
||||
s
|
||||
"could not parse {s} into an ec level"
|
||||
))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,8 +69,7 @@ impl Mode {
|
||||
Ok(Self::HANZI)
|
||||
}
|
||||
_ => Err(Exceptions::IllegalArgumentException(Some(format!(
|
||||
"{} is not valid",
|
||||
bits
|
||||
"{bits} is not valid"
|
||||
)))),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user