Skip to content

Commit 7e722c0

Browse files
committed
fix: clippy errors
1 parent 9b254ce commit 7e722c0

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

packages/axum-http-tracker-server/src/server.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl Launcher {
4747
#[instrument(skip(self, http_tracker_container, tx_start, rx_halt))]
4848
fn start(
4949
&self,
50-
http_tracker_container: Arc<HttpTrackerCoreContainer>,
50+
http_tracker_container: &Arc<HttpTrackerCoreContainer>,
5151
tx_start: Sender<Started>,
5252
rx_halt: Receiver<Halted>,
5353
) -> BoxFuture<'static, ()> {
@@ -69,7 +69,7 @@ impl Launcher {
6969

7070
tracing::info!(target: HTTP_TRACKER_LOG_TARGET, "Starting on: {protocol}://{address}");
7171

72-
let app = router(http_tracker_container, service_binding.clone());
72+
let app = router(http_tracker_container, &service_binding);
7373

7474
let running = Box::pin(async {
7575
match tls {
@@ -176,7 +176,7 @@ impl HttpServer<Stopped> {
176176
let launcher = self.state.launcher;
177177

178178
let task = tokio::spawn(async move {
179-
let server = launcher.start(http_tracker_container, tx_start, rx_halt);
179+
let server = launcher.start(&http_tracker_container, tx_start, rx_halt);
180180

181181
server.await;
182182

packages/axum-http-tracker-server/src/v1/routes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use crate::HTTP_TRACKER_LOG_TARGET;
3131
/// > **NOTICE**: it's added a layer to get the client IP from the connection
3232
/// > info. The tracker could use the connection info to get the client IP.
3333
#[instrument(skip(http_tracker_container, server_service_binding))]
34-
pub fn router(http_tracker_container: Arc<HttpTrackerCoreContainer>, server_service_binding: ServiceBinding) -> Router {
34+
pub fn router(http_tracker_container: &Arc<HttpTrackerCoreContainer>, server_service_binding: &ServiceBinding) -> Router {
3535
let server_socket_addr = server_service_binding.bind_address();
3636

3737
Router::new()

packages/axum-rest-tracker-api-server/src/routes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ use crate::API_LOG_TARGET;
3636
/// Add all API routes to the router.
3737
#[instrument(skip(http_api_container, access_tokens))]
3838
pub fn router(
39-
http_api_container: Arc<TrackerHttpApiCoreContainer>,
39+
http_api_container: &Arc<TrackerHttpApiCoreContainer>,
4040
access_tokens: Arc<AccessTokens>,
4141
server_socket_addr: SocketAddr,
4242
) -> Router {
4343
let router = Router::new();
4444

4545
let api_url_prefix = "/api";
4646

47-
let router = v1::routes::add(api_url_prefix, router, &http_api_container);
47+
let router = v1::routes::add(api_url_prefix, router, http_api_container);
4848

4949
let state = State { access_tokens };
5050

packages/axum-rest-tracker-api-server/src/server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl ApiServer<Stopped> {
140140
let task = tokio::spawn(async move {
141141
tracing::debug!(target: API_LOG_TARGET, "Starting with launcher in spawned task ...");
142142

143-
let _task = launcher.start(http_api_container, access_tokens, tx_start, rx_halt).await;
143+
let _task = launcher.start(&http_api_container, access_tokens, tx_start, rx_halt).await;
144144

145145
tracing::debug!(target: API_LOG_TARGET, "Started with launcher in spawned task");
146146

@@ -241,7 +241,7 @@ impl Launcher {
241241
#[instrument(skip(self, http_api_container, access_tokens, tx_start, rx_halt))]
242242
pub fn start(
243243
&self,
244-
http_api_container: Arc<TrackerHttpApiCoreContainer>,
244+
http_api_container: &Arc<TrackerHttpApiCoreContainer>,
245245
access_tokens: Arc<AccessTokens>,
246246
tx_start: Sender<Started>,
247247
rx_halt: Receiver<Halted>,

packages/torrent-repository-benchmarking/tests/repository/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,9 @@ async fn it_should_import_persistent_torrents(
450450
make(&repo, &entries).await;
451451

452452
let mut downloaded = repo.get_metrics().await.total_downloaded;
453-
persistent_torrents.iter().for_each(|(_, d)| downloaded += u64::from(*d));
453+
for d in persistent_torrents.values() {
454+
downloaded += u64::from(*d);
455+
}
454456

455457
repo.import_persistent(&persistent_torrents).await;
456458

packages/udp-tracker-server/src/handlers/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use crate::event::UdpRequestKind;
2828
use crate::CurrentClock;
2929

3030
#[derive(Debug, Clone, PartialEq)]
31-
pub(super) struct CookieTimeValues {
31+
pub struct CookieTimeValues {
3232
pub(super) issue_time: f64,
3333
pub(super) valid_range: Range<f64>,
3434
}

0 commit comments

Comments
 (0)