Skip to content

Commit 6686dcf

Browse files
committed
chore: fix linting errors
1 parent 209b52c commit 6686dcf

File tree

10 files changed

+19
-26
lines changed

10 files changed

+19
-26
lines changed

packages/configuration/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! This module contains the configuration data structures for the
44
//! Torrust Tracker, which is a `BitTorrent` tracker server.
55
//!
6-
//! The current version for configuration is [`v2`].
6+
//! The current version for configuration is [`v2_0_0`].
77
pub mod v2_0_0;
88
pub mod validator;
99

packages/configuration/src/v2_0_0/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
//! Please refer to the documentation of each structure for more information
4040
//! about each section.
4141
//!
42-
//! - [`Core configuration`](crate::v2::Configuration)
43-
//! - [`HTTP API configuration`](crate::v2::tracker_api::HttpApi)
44-
//! - [`HTTP Tracker configuration`](crate::v2::http_tracker::HttpTracker)
45-
//! - [`UDP Tracker configuration`](crate::v2::udp_tracker::UdpTracker)
46-
//! - [`Health Check API configuration`](crate::v2::health_check_api::HealthCheckApi)
42+
//! - [`Core configuration`](crate::v2_0_0::Configuration)
43+
//! - [`HTTP API configuration`](crate::v2_0_0::tracker_api::HttpApi)
44+
//! - [`HTTP Tracker configuration`](crate::v2_0_0::http_tracker::HttpTracker)
45+
//! - [`UDP Tracker configuration`](crate::v2_0_0::udp_tracker::UdpTracker)
46+
//! - [`Health Check API configuration`](crate::v2_0_0::health_check_api::HealthCheckApi)
4747
//!
4848
//! ## Port binding
4949
//!
@@ -78,7 +78,7 @@
7878
//!
7979
//! Alternatively, you could setup a reverse proxy like Nginx or Apache to
8080
//! handle the SSL/TLS part and forward the requests to the tracker. If you do
81-
//! that, you should set [`on_reverse_proxy`](crate::v2::network::Network::on_reverse_proxy)
81+
//! that, you should set [`on_reverse_proxy`](crate::v2_0_0::network::Network::on_reverse_proxy)
8282
//! to `true` in the configuration file. It's out of scope for this
8383
//! documentation to explain in detail how to setup a reverse proxy, but the
8484
//! configuration file should be something like this:

packages/http-protocol/src/v1/requests/announce.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ impl fmt::Display for Event {
185185
/// Depending on the value of this param, the tracker will return a different
186186
/// response:
187187
///
188-
/// - [`Normal`](crate::servers::http::v1::responses::announce::Normal), i.e. a `non-compact` response.
189-
/// - [`Compact`](crate::servers::http::v1::responses::announce::Compact) response.
188+
/// - [`Normal`](crate::v1::responses::announce::Normal), i.e. a `non-compact` response.
189+
/// - [`Compact`](crate::v1::responses::announce::Compact) response.
190190
///
191191
/// Refer to [BEP 23. Tracker Returns Compact Peer Lists](https://www.bittorrent.org/beps/bep_0023.html)
192192
#[derive(PartialEq, Debug)]
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
//! HTTP requests for the HTTP tracker.
2-
//!
3-
//! Refer to the generic [HTTP server documentation](crate::servers::http) for
4-
//! more information about the HTTP tracker.
52
pub mod announce;
63
pub mod scrape;

packages/http-protocol/src/v1/responses/announce.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! `Announce` response for the HTTP tracker [`announce`](bittorrent_http_protocol::v1::requests::announce::Announce) request.
1+
//! `Announce` response for the HTTP tracker [`announce`](crate::v1::requests::announce::Announce) request.
22
//!
33
//! Data structures and logic to build the `announce` response.
44
use std::io::Write;

packages/http-protocol/src/v1/responses/error.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! `Error` response for the [`HTTP tracker`](crate::servers::http).
1+
//! `Error` response for the HTTP tracker.
22
//!
33
//! Data structures and logic to build the error responses.
44
//!
@@ -15,7 +15,7 @@ use serde::Serialize;
1515

1616
use crate::v1::services::peer_ip_resolver::PeerIpResolutionError;
1717

18-
/// `Error` response for the [`HTTP tracker`](crate::servers::http).
18+
/// `Error` response for the HTTP tracker.
1919
#[derive(Serialize, Debug, PartialEq)]
2020
pub struct Error {
2121
/// Human readable string which explains why the request failed.

packages/http-protocol/src/v1/responses/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
//! HTTP responses for the HTTP tracker.
2-
//!
3-
//! Refer to the generic [HTTP server documentation](crate::servers::http) for
4-
//! more information about the HTTP tracker.
52
pub mod announce;
63
pub mod error;
74
pub mod scrape;

packages/http-protocol/src/v1/responses/scrape.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! `Scrape` response for the HTTP tracker [`scrape`](bittorrent_http_protocol::v1::requests::scrape::Scrape) request.
1+
//! `Scrape` response for the HTTP tracker [`scrape`](crate::v1::requests::scrape::Scrape) request.
22
//!
33
//! Data structures and logic to build the `scrape` response.
44
use std::borrow::Cow;

src/core/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
//! The tracker responds to the peer with the list of other peers in the swarm so that
5353
//! the peer can contact them to start downloading pieces of the file from them.
5454
//!
55-
//! Once you have instantiated the `Tracker` you can `announce` a new [`peer::Peer`] with:
55+
//! Once you have instantiated the `AnnounceHandler` you can `announce` a new [`peer::Peer`](torrust_tracker_primitives::peer::Peer) with:
5656
//!
5757
//! ```rust,no_run
5858
//! use std::net::SocketAddr;
@@ -80,8 +80,8 @@
8080
//! let peer_ip = IpAddr::V4(Ipv4Addr::from_str("126.0.0.1").unwrap());
8181
//! ```
8282
//!
83-
//! ```text
84-
//! let announce_data = tracker.announce(&info_hash, &mut peer, &peer_ip).await;
83+
//! ```rust,no_run
84+
//! let announce_data = announce_handler.announce(&info_hash, &mut peer, &peer_ip).await;
8585
//! ```
8686
//!
8787
//! The `Tracker` returns the list of peers for the torrent with the infohash `3b245504cf5f11bbdbe1201cea6a6bf45aee1bc0`,
@@ -306,7 +306,7 @@
306306
//! `c1277613db1d28709b034a017ab2cae4be07ae10` is the torrent infohash and `completed` contains the number of peers
307307
//! that have a full version of the torrent data, also known as seeders.
308308
//!
309-
//! Refer to [`peer`] module for more information about peers.
309+
//! Refer to [`peer`](torrust_tracker_primitives::peer) for more information about peers.
310310
//!
311311
//! # Configuration
312312
//!

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
//!
33
//! The service is responsible for handling the `announce` requests.
44
//!
5-
//! It delegates the `announce` logic to the [`Tracker`](crate::core::Tracker::announce)
6-
//! and it returns the [`AnnounceData`] returned
7-
//! by the [`Tracker`].
5+
//! It delegates the `announce` logic to the [`AnnounceHandler`] and it returns
6+
//! the [`AnnounceData`].
87
//!
98
//! It also sends an [`statistics::event::Event`]
109
//! because events are specific for the HTTP tracker.

0 commit comments

Comments
 (0)