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:
@@ -53,7 +53,7 @@ pub const WORD_SIZE: [u32; 33] = [
|
||||
pub fn encode_simple(data: &str) -> Result<AztecCode, Exceptions> {
|
||||
let Ok(bytes) = encoding::all::ISO_8859_1
|
||||
.encode(data, encoding::EncoderTrap::Replace) else {
|
||||
return Err(Exceptions::IllegalArgumentException(Some(format!("'{}' cannot be encoded as ISO_8859_1", data))));
|
||||
return Err(Exceptions::IllegalArgumentException(Some(format!("'{data}' cannot be encoded as ISO_8859_1"))));
|
||||
};
|
||||
encode_bytes_simple(&bytes)
|
||||
}
|
||||
@@ -76,8 +76,7 @@ pub fn encode(
|
||||
encode_bytes(&bytes, minECCPercent, userSpecifiedLayers)
|
||||
} else {
|
||||
Err(Exceptions::IllegalArgumentException(Some(format!(
|
||||
"'{}' cannot be encoded as ISO_8859_1",
|
||||
data
|
||||
"'{data}' cannot be encoded as ISO_8859_1"
|
||||
))))
|
||||
}
|
||||
}
|
||||
@@ -104,8 +103,7 @@ pub fn encode_with_charset(
|
||||
encode_bytes_with_charset(&bytes, minECCPercent, userSpecifiedLayers, charset)
|
||||
} else {
|
||||
Err(Exceptions::IllegalArgumentException(Some(format!(
|
||||
"'{}' cannot be encoded as ISO_8859_1",
|
||||
data
|
||||
"'{data}' cannot be encoded as ISO_8859_1"
|
||||
))))
|
||||
}
|
||||
}
|
||||
@@ -181,8 +179,7 @@ pub fn encode_bytes_with_charset(
|
||||
})
|
||||
{
|
||||
return Err(Exceptions::IllegalArgumentException(Some(format!(
|
||||
"Illegal value {} for layers",
|
||||
user_specified_layers
|
||||
"Illegal value {user_specified_layers} for layers"
|
||||
))));
|
||||
}
|
||||
total_bits_in_layer_var = total_bits_in_layer(layers, compact);
|
||||
@@ -498,8 +495,7 @@ fn getGF(wordSize: usize) -> Result<GenericGFRef, Exceptions> {
|
||||
10 => Ok(get_predefined_genericgf(PredefinedGenericGF::AztecData10)),
|
||||
12 => Ok(get_predefined_genericgf(PredefinedGenericGF::AztecData12)),
|
||||
_ => Err(Exceptions::IllegalArgumentException(Some(format!(
|
||||
"Unsupported word size {}",
|
||||
wordSize
|
||||
"Unsupported word size {wordSize}"
|
||||
)))),
|
||||
}
|
||||
// switch (wordSize) {
|
||||
|
||||
@@ -86,7 +86,7 @@ impl State {
|
||||
// throw new IllegalArgumentException("ECI code must be between 0 and 999999");
|
||||
} else {
|
||||
let eci_digits = encoding::all::ISO_8859_1
|
||||
.encode(&format!("{}", eci), encoding::EncoderTrap::Strict)
|
||||
.encode(&format!("{eci}"), encoding::EncoderTrap::Strict)
|
||||
.unwrap();
|
||||
// let eciDigits = Integer.toString(eci).getBytes(StandardCharsets.ISO_8859_1);
|
||||
token.add(eci_digits.len() as i32, 3); // 1-6: number of ECI digits
|
||||
|
||||
Reference in New Issue
Block a user