mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
Implement clippy suggestions
This commit is contained in:
@@ -65,19 +65,19 @@ impl X12Encoder {
|
||||
'>' => sb.push('\u{2}'),
|
||||
' ' => sb.push('\u{3}'),
|
||||
_ => {
|
||||
if c >= '0' && c <= '9' {
|
||||
if ('0'..='9').contains(&c) {
|
||||
sb.push((c as u8 - 48 + 4) as char);
|
||||
} else if c >= 'A' && c <= 'Z' {
|
||||
} else if ('A'..='Z').contains(&c) {
|
||||
sb.push((c as u8 - 65 + 14) as char);
|
||||
} else {
|
||||
high_level_encoder::illegalCharacter(c).expect("detect_illegal_character");
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
1
|
||||
}
|
||||
|
||||
fn handleEOD(context: &mut EncoderContext, buffer: &mut String) -> Result<(), Exceptions> {
|
||||
fn handleEOD(context: &mut EncoderContext, buffer: &mut str) -> Result<(), Exceptions> {
|
||||
context.updateSymbolInfo();
|
||||
let available =
|
||||
context.getSymbolInfo().unwrap().getDataCapacity() - context.getCodewordCount() as u32;
|
||||
@@ -95,3 +95,9 @@ impl X12Encoder {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for X12Encoder {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user