cargo clippy --fix

This commit is contained in:
Henry Schimke
2023-01-27 15:24:24 -06:00
parent 58e6827e89
commit 42d40de755
86 changed files with 196 additions and 335 deletions

View File

@@ -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}"
))))
}
}

View File

@@ -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}"
))));
}
}

View File

@@ -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}");
}
}

View File

@@ -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];

View File

@@ -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})"
))))
}

View File

@@ -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())

View File

@@ -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)