applies review comments: one liners when accessing pendingBlocksIter

This commit is contained in:
Marcin Czenko 2025-06-25 15:42:17 +02:00
parent 61783dba19
commit 4383211b8d
No known key found for this signature in database
GPG Key ID: 33DEA0C8E30937C0

View File

@ -187,8 +187,7 @@ proc prepareEncodingData(
var resolved = 0
for fut in pendingBlocksIter:
let pendingBlocksRes = await fut
without (blkOrErr, idx) =? pendingBlocksRes, err:
without (blkOrErr, idx) =? (await fut), err:
return failure(err)
without blk =? blkOrErr, err:
warn "Failed retrieving a block", treeCid = manifest.treeCid, idx, msg = err.msg
@ -246,8 +245,7 @@ proc prepareDecodingData(
if resolved >= encoded.ecK:
break
let pendingBlocksRes = await fut
without (blkOrErr, idx) =? pendingBlocksRes, err:
without (blkOrErr, idx) =? (await fut), err:
return failure(err)
without blk =? blkOrErr, err:
trace "Failed retrieving a block", idx, treeCid = encoded.treeCid, msg = err.msg