updated cargo fmt

This commit is contained in:
Henry Schimke
2023-10-28 11:04:14 -05:00
parent 4c9ec95d00
commit 5ea03cc066
24 changed files with 122 additions and 64 deletions

View File

@@ -49,8 +49,10 @@ pub const WORD_SIZE: [u32; 33] = [
* @return Aztec symbol matrix with metadata
*/
pub fn encode_simple(data: &str) -> Result<AztecCode> {
let Ok(bytes) =CharacterSet::ISO8859_1.encode_replace(data) else {
return Err(Exceptions::illegal_argument_with(format!("'{data}' cannot be encoded as ISO_8859_1")));
let Ok(bytes) = CharacterSet::ISO8859_1.encode_replace(data) else {
return Err(Exceptions::illegal_argument_with(format!(
"'{data}' cannot be encoded as ISO_8859_1"
)));
};
encode_bytes_simple(&bytes)
}

View File

@@ -86,11 +86,9 @@ impl State {
));
// throw new IllegalArgumentException("ECI code must be between 0 and 999999");
} else {
let Ok(eci_digits) = CharacterSet::ISO8859_1
.encode(&format!("{eci}"))
else {
return Err(Exceptions::ILLEGAL_ARGUMENT)
};
let Ok(eci_digits) = CharacterSet::ISO8859_1.encode(&format!("{eci}")) else {
return Err(Exceptions::ILLEGAL_ARGUMENT);
};
// let eciDigits = Integer.toString(eci).getBytes(StandardCharsets.ISO_8859_1);
token.add(eci_digits.len() as i32, 3); // 1-6: number of ECI digits
for eci_digit in &eci_digits {