Skip to content

Commit 7d85d29

Browse files
committed
fix casting errors
1 parent 192061e commit 7d85d29

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,8 +1097,12 @@ impl wallet_server::Wallet for WalletGrpcServer {
10971097
});
10981098

10991099
let req = request.into_inner();
1100-
let offset = req.offset as usize;
1101-
let limit = if req.limit > 0 { req.limit as usize } else { usize::MAX };
1100+
let offset = usize::try_from(req.offset).unwrap_or(0);
1101+
let limit = if req.limit > 0 {
1102+
usize::try_from(req.limit).unwrap_or(usize::MAX)
1103+
} else {
1104+
usize::MAX
1105+
};
11021106
let transactions = completed_transactions
11031107
.into_iter()
11041108
.skip(offset)

0 commit comments

Comments
 (0)