Skip to content

Commit 4946195

Browse files
committed
chore: clippy --fix
1 parent 2f58db7 commit 4946195

3 files changed

Lines changed: 14 additions & 19 deletions

File tree

src/datamatrix/decoder/decoded_bit_stream_parser.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,8 @@ fn decodeTextSegment(
540540
}
541541
shift = 0;
542542
}
543-
3 => {
544-
if cValue < TEXT_SHIFT3_SET_CHARS.len() as u32 {
543+
3
544+
if cValue < TEXT_SHIFT3_SET_CHARS.len() as u32 => {
545545
let textChar = TEXT_SHIFT3_SET_CHARS[cValue as usize];
546546
if upperShift {
547547
result.append_char(
@@ -552,10 +552,7 @@ fn decodeTextSegment(
552552
result.append_char(textChar);
553553
}
554554
shift = 0;
555-
} else {
556-
return Err(Exceptions::FORMAT);
557555
}
558-
}
559556

560557
_ => return Err(Exceptions::FORMAT),
561558
}

src/oned/code_128_writer.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,17 @@ fn check(contents: &str, hints: &crate::EncodeHints) -> Result<i32> {
160160
)));
161161
}
162162
}
163-
CODE_CODE_C_I32 =>
164163
// allows only numbers and no FNC 2/3/4
165-
{
166-
if c < 48
164+
CODE_CODE_C_I32
165+
if (c < 48
167166
|| (c > 57 && c <= 127)
168167
|| ch == ESCAPE_FNC_2
169168
|| ch == ESCAPE_FNC_3
170-
|| ch == ESCAPE_FNC_4
171-
{
172-
return Err(Exceptions::illegal_argument_with(format!(
173-
"Bad character in input for forced code set C: ASCII value={c}"
174-
)));
175-
}
169+
|| ch == ESCAPE_FNC_4) =>
170+
{
171+
return Err(Exceptions::illegal_argument_with(format!(
172+
"Bad character in input for forced code set C: ASCII value={c}"
173+
)));
176174
}
177175
_ => {}
178176
}

src/qrcode/encoder/minimal_encoder.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -837,16 +837,16 @@ impl RXingResultList {
837837
}
838838

839839
fn getSizeLocal(&self, version: VersionRef) -> u32 {
840-
let result = self
840+
841+
self
841842
.list
842843
.iter()
843-
.fold(0, |acc, node| acc + node.getSize(version));
844-
result
844+
.fold(0, |acc, node| acc + node.getSize(version))
845845
}
846846

847847
fn internal_static_get_size(version: VersionRef, list: &[RXingResultNode]) -> u32 {
848-
let result = list.iter().fold(0, |acc, node| acc + node.getSize(version));
849-
result
848+
849+
list.iter().fold(0, |acc, node| acc + node.getSize(version))
850850
}
851851

852852
/**

0 commit comments

Comments
 (0)