mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +00:00
aquatic_http, aquatic_common_tcp: fix some clippy warnings
This commit is contained in:
parent
8269ae2994
commit
b65297195a
5 changed files with 8 additions and 11 deletions
|
|
@ -95,7 +95,7 @@ pub fn handle_announce_requests(
|
|||
){
|
||||
let valid_until = ValidUntil::new(config.cleaning.max_peer_age);
|
||||
|
||||
responses.extend(requests.into_iter().map(|(request_sender_meta, request)| {
|
||||
responses.extend(requests.map(|(request_sender_meta, request)| {
|
||||
let torrent_data: &mut TorrentData = if request_sender_meta.peer_addr.is_ipv4(){
|
||||
torrent_maps.ipv4.entry(request.info_hash).or_default()
|
||||
} else {
|
||||
|
|
@ -117,7 +117,7 @@ pub fn handle_announce_requests(
|
|||
};
|
||||
|
||||
let ip_or_key = request.key
|
||||
.map(|k| Either::Right(k))
|
||||
.map(Either::Right)
|
||||
.unwrap_or_else(||
|
||||
Either::Left(request_sender_meta.peer_addr.ip())
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue