Skip to content

Commit cf9e9a9

Browse files
committed
fix: merge conflicts
1 parent a611fbd commit cf9e9a9

File tree

6 files changed

+14
-11
lines changed

6 files changed

+14
-11
lines changed

src/http/axum_implementation/handlers/announce.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ mod tests {
182182
let (stats_event_sender, stats_repository) = Keeper::new_active_instance();
183183

184184
// Initialize Torrust tracker
185-
match Tracker::new(&Arc::new(configuration), Some(stats_event_sender), stats_repository) {
185+
match Tracker::new(Arc::new(configuration), Some(stats_event_sender), stats_repository) {
186186
Ok(tracker) => tracker,
187187
Err(error) => {
188188
panic!("{}", error)

src/http/axum_implementation/handlers/scrape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ mod tests {
140140
let (stats_event_sender, stats_repository) = Keeper::new_active_instance();
141141

142142
// Initialize Torrust tracker
143-
match Tracker::new(&Arc::new(configuration), Some(stats_event_sender), stats_repository) {
143+
match Tracker::new(Arc::new(configuration), Some(stats_event_sender), stats_repository) {
144144
Ok(tracker) => tracker,
145145
Err(error) => {
146146
panic!("{}", error)

src/http/axum_implementation/routes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub fn router(tracker: Arc<Tracker>) -> Router {
1515
.route("/announce/:key", get(announce::handle_with_key).with_state(tracker.clone()))
1616
// Scrape request
1717
.route("/scrape", get(scrape::handle_without_key).with_state(tracker.clone()))
18-
.route("/scrape/:key", get(scrape::handle_with_key).with_state(tracker.clone()))
18+
.route("/scrape/:key", get(scrape::handle_with_key).with_state(tracker))
1919
// Add extension to get the client IP from the connection info
2020
.layer(SecureClientIpSource::ConnectInfo.into_extension())
2121
}

src/http/axum_implementation/services/announce.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ mod tests {
5151
let (stats_event_sender, stats_repository) = Keeper::new_active_instance();
5252

5353
// Initialize Torrust tracker
54-
match Tracker::new(&Arc::new(configuration), Some(stats_event_sender), stats_repository) {
54+
match Tracker::new(Arc::new(configuration), Some(stats_event_sender), stats_repository) {
5555
Ok(tracker) => tracker,
5656
Err(error) => {
5757
panic!("{}", error)
@@ -137,7 +137,7 @@ mod tests {
137137

138138
let tracker = Arc::new(
139139
Tracker::new(
140-
&Arc::new(configuration::ephemeral()),
140+
Arc::new(configuration::ephemeral()),
141141
Some(stats_event_sender),
142142
statistics::Repo::new(),
143143
)
@@ -154,7 +154,7 @@ mod tests {
154154
configuration.external_ip =
155155
Some(IpAddr::V6(Ipv6Addr::new(0x6969, 0x6969, 0x6969, 0x6969, 0x6969, 0x6969, 0x6969, 0x6969)).to_string());
156156

157-
Tracker::new(&Arc::new(configuration), Some(stats_event_sender), statistics::Repo::new()).unwrap()
157+
Tracker::new(Arc::new(configuration), Some(stats_event_sender), statistics::Repo::new()).unwrap()
158158
}
159159

160160
fn peer_with_the_ipv4_loopback_ip() -> Peer {
@@ -201,7 +201,7 @@ mod tests {
201201

202202
let tracker = Arc::new(
203203
Tracker::new(
204-
&Arc::new(configuration::ephemeral()),
204+
Arc::new(configuration::ephemeral()),
205205
Some(stats_event_sender),
206206
statistics::Repo::new(),
207207
)

src/tracker/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ mod tests {
552552

553553
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
554554
use std::str::FromStr;
555+
use std::sync::Arc;
555556

556557
use aquatic_udp_protocol::{AnnounceEvent, NumberOfBytes};
557558
use torrust_tracker_primitives::TrackerMode;
@@ -566,25 +567,25 @@ mod tests {
566567
pub fn public_tracker() -> Tracker {
567568
let mut configuration = configuration::ephemeral();
568569
configuration.mode = TrackerMode::Public;
569-
tracker_factory(configuration)
570+
tracker_factory(Arc::new(configuration))
570571
}
571572

572573
pub fn private_tracker() -> Tracker {
573574
let mut configuration = configuration::ephemeral();
574575
configuration.mode = TrackerMode::Private;
575-
tracker_factory(configuration)
576+
tracker_factory(Arc::new(configuration))
576577
}
577578

578579
pub fn whitelisted_tracker() -> Tracker {
579580
let mut configuration = configuration::ephemeral();
580581
configuration.mode = TrackerMode::Listed;
581-
tracker_factory(configuration)
582+
tracker_factory(Arc::new(configuration))
582583
}
583584

584585
pub fn tracker_persisting_torrents_in_database() -> Tracker {
585586
let mut configuration = configuration::ephemeral();
586587
configuration.persistent_torrent_completed_stat = true;
587-
tracker_factory(configuration)
588+
tracker_factory(Arc::new(configuration))
588589
}
589590

590591
fn sample_info_hash() -> InfoHash {

tests/http_tracker.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,7 @@ mod warp_test_env {
11981198

11991199
use torrust_tracker::protocol::info_hash::InfoHash;
12001200
use torrust_tracker::tracker::auth::Key;
1201+
use torrust_tracker_test_helpers::configuration;
12011202

12021203
use crate::http::asserts::assert_is_announce_response;
12031204
use crate::http::asserts_warp::{
@@ -2616,6 +2617,7 @@ mod axum_test_env {
26162617

26172618
use torrust_tracker::protocol::info_hash::InfoHash;
26182619
use torrust_tracker::tracker::auth::Key;
2620+
use torrust_tracker_test_helpers::configuration;
26192621

26202622
use crate::http::asserts::{assert_authentication_error_response, assert_is_announce_response};
26212623
use crate::http::client::Client;

0 commit comments

Comments
 (0)