many small rustifications

This commit is contained in:
Henry Schimke
2023-01-10 14:33:47 -06:00
parent 752d8c87b9
commit 9f7a41f81c
23 changed files with 218 additions and 187 deletions

View File

@@ -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);