mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
many small rustifications
This commit is contained in:
@@ -56,11 +56,10 @@ impl DataBlock {
|
||||
let ecBlocks = version.getECBlocks();
|
||||
|
||||
// First count the total number of data blocks
|
||||
let mut totalBlocks = 0_usize;
|
||||
let ecBlockArray = ecBlocks.getECBlocks();
|
||||
for ecBlock in ecBlockArray {
|
||||
totalBlocks += ecBlock.getCount() as usize;
|
||||
}
|
||||
let totalBlocks = ecBlockArray.iter().fold(0, |acc, ecBlock| {
|
||||
acc + ecBlock.getCount() as usize
|
||||
});
|
||||
|
||||
// Now establish DataBlocks of the appropriate size and number of data codewords
|
||||
let mut result = Vec::with_capacity(totalBlocks);
|
||||
|
||||
Reference in New Issue
Block a user