Skip to content

Commit ba61af0

Browse files
committed
chore: fix new clippy warning
1 parent c5dc3dc commit ba61af0

8 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/servers/apis/v1/context/auth_key/handlers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub async fn delete_auth_key_handler(
7070
match Key::from_str(&seconds_valid_or_key.0) {
7171
Err(_) => invalid_auth_key_param_response(&seconds_valid_or_key.0),
7272
Ok(key) => match tracker.remove_auth_key(&key).await {
73-
Ok(_) => ok_response(),
73+
Ok(()) => ok_response(),
7474
Err(e) => failed_to_delete_key_response(e),
7575
},
7676
}
@@ -90,7 +90,7 @@ pub async fn delete_auth_key_handler(
9090
/// for more information about this endpoint.
9191
pub async fn reload_keys_handler(State(tracker): State<Arc<Tracker>>) -> Response {
9292
match tracker.load_keys_from_database().await {
93-
Ok(_) => ok_response(),
93+
Ok(()) => ok_response(),
9494
Err(e) => failed_to_reload_keys_response(e),
9595
}
9696
}

src/servers/apis/v1/context/whitelist/handlers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub async fn add_torrent_to_whitelist_handler(
3030
match InfoHash::from_str(&info_hash.0) {
3131
Err(_) => invalid_info_hash_param_response(&info_hash.0),
3232
Ok(info_hash) => match tracker.add_torrent_to_whitelist(&info_hash).await {
33-
Ok(_) => ok_response(),
33+
Ok(()) => ok_response(),
3434
Err(e) => failed_to_whitelist_torrent_response(e),
3535
},
3636
}
@@ -53,7 +53,7 @@ pub async fn remove_torrent_from_whitelist_handler(
5353
match InfoHash::from_str(&info_hash.0) {
5454
Err(_) => invalid_info_hash_param_response(&info_hash.0),
5555
Ok(info_hash) => match tracker.remove_torrent_from_whitelist(&info_hash).await {
56-
Ok(_) => ok_response(),
56+
Ok(()) => ok_response(),
5757
Err(e) => failed_to_remove_torrent_from_whitelist_response(e),
5858
},
5959
}
@@ -71,7 +71,7 @@ pub async fn remove_torrent_from_whitelist_handler(
7171
/// for more information about this endpoint.
7272
pub async fn reload_whitelist_handler(State(tracker): State<Arc<Tracker>>) -> Response {
7373
match tracker.load_whitelist_from_database().await {
74-
Ok(_) => ok_response(),
74+
Ok(()) => ok_response(),
7575
Err(e) => failed_to_reload_whitelist_response(e),
7676
}
7777
}

src/servers/http/v1/handlers/announce.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async fn handle_announce(
8787
if tracker.requires_authentication() {
8888
match maybe_key {
8989
Some(key) => match tracker.authenticate(&key).await {
90-
Ok(_) => (),
90+
Ok(()) => (),
9191
Err(error) => return Err(responses::error::Error::from(error)),
9292
},
9393
None => {
@@ -100,7 +100,7 @@ async fn handle_announce(
100100

101101
// Authorization
102102
match tracker.authorize(&announce_request.info_hash).await {
103-
Ok(_) => (),
103+
Ok(()) => (),
104104
Err(error) => return Err(responses::error::Error::from(error)),
105105
}
106106

src/servers/http/v1/handlers/scrape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async fn handle_scrape(
7878
let return_real_scrape_data = if tracker.requires_authentication() {
7979
match maybe_key {
8080
Some(key) => match tracker.authenticate(&key).await {
81-
Ok(_) => true,
81+
Ok(()) => true,
8282
Err(_error) => false,
8383
},
8484
None => false,

src/servers/signals.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ pub async fn global_shutdown_signal() {
2323
let terminate = std::future::pending::<()>();
2424

2525
tokio::select! {
26-
_ = ctrl_c => {},
27-
_ = terminate => {}
26+
() = ctrl_c => {},
27+
() = terminate => {}
2828
}
2929
}
3030

@@ -38,7 +38,7 @@ pub async fn shutdown_signal(stop_receiver: tokio::sync::oneshot::Receiver<u8>)
3838

3939
tokio::select! {
4040
_ = stop => {},
41-
_ = global_shutdown_signal() => {}
41+
() = global_shutdown_signal() => {}
4242
}
4343
}
4444

src/servers/udp/server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl Udp {
220220
let socket = self.socket.clone();
221221

222222
tokio::select! {
223-
_ = &mut shutdown_signal => {
223+
() = &mut shutdown_signal => {
224224
info!("Stopping UDP server: {}..", self.socket.local_addr().unwrap());
225225
break;
226226
}
@@ -244,7 +244,7 @@ impl Udp {
244244
let mut cursor = Cursor::new(buffer);
245245

246246
match response.write(&mut cursor) {
247-
Ok(_) => {
247+
Ok(()) => {
248248
#[allow(clippy::cast_possible_truncation)]
249249
let position = cursor.position() as usize;
250250
let inner = cursor.get_ref();

src/tracker/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ impl Tracker {
643643

644644
for info_hash in info_hashes {
645645
let swarm_metadata = match self.authorize(info_hash).await {
646-
Ok(_) => self.get_swarm_metadata(info_hash).await,
646+
Ok(()) => self.get_swarm_metadata(info_hash).await,
647647
Err(_) => SwarmMetadata::zeroed(),
648648
};
649649
scrape_data.add_file(info_hash, swarm_metadata);

tests/servers/udp/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl UdpTrackerClient {
5555
let mut cursor = Cursor::new(request_buffer);
5656

5757
let request_data = match request.write(&mut cursor) {
58-
Ok(_) => {
58+
Ok(()) => {
5959
#[allow(clippy::cast_possible_truncation)]
6060
let position = cursor.position() as usize;
6161
let inner_request_buffer = cursor.get_ref();

0 commit comments

Comments
 (0)