mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
udp: handle_announce_request: don't cast usize to i32, use try_into
This commit is contained in:
parent
8beb13db29
commit
5889cb22f7
1 changed files with 2 additions and 2 deletions
|
|
@ -163,8 +163,8 @@ fn handle_announce_request<I: Ip>(
|
|||
AnnounceResponse {
|
||||
transaction_id: request.transaction_id,
|
||||
announce_interval: AnnounceInterval(config.protocol.peer_announce_interval),
|
||||
leechers: NumberOfPeers(torrent_data.num_leechers() as i32),
|
||||
seeders: NumberOfPeers(torrent_data.num_seeders() as i32),
|
||||
leechers: NumberOfPeers(torrent_data.num_leechers().try_into().unwrap_or(i32::MAX)),
|
||||
seeders: NumberOfPeers(torrent_data.num_seeders().try_into().unwrap_or(i32::MAX)),
|
||||
peers: response_peers,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue