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:
@@ -74,8 +74,7 @@ impl Encoder for ASCIIEncoder {
|
||||
|
||||
_ => {
|
||||
return Err(Exceptions::IllegalStateException(Some(format!(
|
||||
"Illegal mode: {}",
|
||||
newMode
|
||||
"Illegal mode: {newMode}"
|
||||
))));
|
||||
}
|
||||
}
|
||||
@@ -106,8 +105,7 @@ impl ASCIIEncoder {
|
||||
Ok((num + 130) as char)
|
||||
} else {
|
||||
Err(Exceptions::IllegalArgumentException(Some(format!(
|
||||
"not digits: {}{}",
|
||||
digit1, digit2
|
||||
"not digits: {digit1}{digit2}"
|
||||
))))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,8 +66,7 @@ impl Encoder for Base256Encoder {
|
||||
buffer.insert(ci_pos, char::from_u32(dataCount as u32 % 250).unwrap());
|
||||
} else {
|
||||
return Err(Exceptions::IllegalStateException(Some(format!(
|
||||
"Message length not in valid ranges: {}",
|
||||
dataCount
|
||||
"Message length not in valid ranges: {dataCount}"
|
||||
))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ mod test_placement {
|
||||
let actual = placement.toBitFieldStringArray();
|
||||
for i in 0..actual.len() {
|
||||
// for (int i = 0; i < actual.length; i++) {
|
||||
assert_eq!(expected[i], actual[i], "Row {}", i);
|
||||
assert_eq!(expected[i], actual[i], "Row {i}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -221,8 +221,7 @@ fn createECCBlock(codewords: &str, numECWords: usize) -> Result<String, Exceptio
|
||||
}
|
||||
if table < 0 {
|
||||
return Err(Exceptions::IllegalArgumentException(Some(format!(
|
||||
"Illegal number of error correction codewords specified: {}",
|
||||
numECWords
|
||||
"Illegal number of error correction codewords specified: {numECWords}"
|
||||
))));
|
||||
}
|
||||
let poly = &FACTORS[table as usize];
|
||||
|
||||
@@ -603,7 +603,6 @@ pub fn illegalCharacter(c: char) -> Result<(), Exceptions> {
|
||||
// let hex = Integer.toHexString(c);
|
||||
// hex = "0000".substring(0, 4 - hex.length()) + hex;
|
||||
Err(Exceptions::IllegalArgumentException(Some(format!(
|
||||
"Illegal character: {} (0x{})",
|
||||
c, c
|
||||
"Illegal character: {c} (0x{c})"
|
||||
))))
|
||||
}
|
||||
|
||||
@@ -640,8 +640,7 @@ fn encodeMinimally(input: Rc<Input>) -> Result<RXingResult, Exceptions> {
|
||||
|
||||
if minimalJ < 0 {
|
||||
return Err(Exceptions::IllegalStateException(Some(format!(
|
||||
"Internal error: failed to encode \"{}\"",
|
||||
input
|
||||
"Internal error: failed to encode \"{input}\""
|
||||
))));
|
||||
}
|
||||
RXingResult::new(edges[inputLength][minimalJ as usize].clone())
|
||||
|
||||
@@ -346,8 +346,7 @@ impl<'a> SymbolInfoLookup<'a> {
|
||||
}
|
||||
if fail {
|
||||
return Err(Exceptions::IllegalArgumentException(Some(format!(
|
||||
"Can't find a symbol arrangement that matches the message. Data codewords: {}",
|
||||
dataCodewords
|
||||
"Can't find a symbol arrangement that matches the message. Data codewords: {dataCodewords}"
|
||||
))));
|
||||
}
|
||||
Ok(None)
|
||||
|
||||
Reference in New Issue
Block a user