mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
udp: handle_announce_request: remove two noop casts
This commit is contained in:
parent
5889cb22f7
commit
9797f24299
1 changed files with 3 additions and 3 deletions
|
|
@ -136,11 +136,11 @@ fn handle_announce_request<I: Ip>(
|
||||||
peer_ip: I,
|
peer_ip: I,
|
||||||
peer_valid_until: ValidUntil,
|
peer_valid_until: ValidUntil,
|
||||||
) -> AnnounceResponse<I> {
|
) -> AnnounceResponse<I> {
|
||||||
let max_num_peers_to_take = if request.peers_wanted.0 <= 0 {
|
let max_num_peers_to_take: usize = if request.peers_wanted.0 <= 0 {
|
||||||
config.protocol.max_response_peers as usize
|
config.protocol.max_response_peers
|
||||||
} else {
|
} else {
|
||||||
::std::cmp::min(
|
::std::cmp::min(
|
||||||
config.protocol.max_response_peers as usize,
|
config.protocol.max_response_peers,
|
||||||
request.peers_wanted.0.try_into().unwrap(),
|
request.peers_wanted.0.try_into().unwrap(),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue