Skip to content

Commit

Permalink
chore: fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Jan 27, 2025
1 parent 209b52c commit 2f74caf
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion packages/configuration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! This module contains the configuration data structures for the
//! Torrust Tracker, which is a `BitTorrent` tracker server.
//!
//! The current version for configuration is [`v2`].
//! The current version for configuration is [`v2_0_0`].
pub mod v2_0_0;
pub mod validator;

Expand Down
12 changes: 6 additions & 6 deletions packages/configuration/src/v2_0_0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
//! Please refer to the documentation of each structure for more information
//! about each section.
//!
//! - [`Core configuration`](crate::v2::Configuration)
//! - [`HTTP API configuration`](crate::v2::tracker_api::HttpApi)
//! - [`HTTP Tracker configuration`](crate::v2::http_tracker::HttpTracker)
//! - [`UDP Tracker configuration`](crate::v2::udp_tracker::UdpTracker)
//! - [`Health Check API configuration`](crate::v2::health_check_api::HealthCheckApi)
//! - [`Core configuration`](crate::v2_0_0::Configuration)
//! - [`HTTP API configuration`](crate::v2_0_0::tracker_api::HttpApi)
//! - [`HTTP Tracker configuration`](crate::v2_0_0::http_tracker::HttpTracker)
//! - [`UDP Tracker configuration`](crate::v2_0_0::udp_tracker::UdpTracker)
//! - [`Health Check API configuration`](crate::v2_0_0::health_check_api::HealthCheckApi)
//!
//! ## Port binding
//!
Expand Down Expand Up @@ -78,7 +78,7 @@
//!
//! Alternatively, you could setup a reverse proxy like Nginx or Apache to
//! handle the SSL/TLS part and forward the requests to the tracker. If you do
//! that, you should set [`on_reverse_proxy`](crate::v2::network::Network::on_reverse_proxy)
//! that, you should set [`on_reverse_proxy`](crate::v2_0_0::network::Network::on_reverse_proxy)
//! to `true` in the configuration file. It's out of scope for this
//! documentation to explain in detail how to setup a reverse proxy, but the
//! configuration file should be something like this:
Expand Down
4 changes: 2 additions & 2 deletions packages/http-protocol/src/v1/requests/announce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ impl fmt::Display for Event {
/// Depending on the value of this param, the tracker will return a different
/// response:
///
/// - [`Normal`](crate::servers::http::v1::responses::announce::Normal), i.e. a `non-compact` response.
/// - [`Compact`](crate::servers::http::v1::responses::announce::Compact) response.
/// - [`Normal`](crate::v1::responses::announce::Normal), i.e. a `non-compact` response.
/// - [`Compact`](crate::v1::responses::announce::Compact) response.
///
/// Refer to [BEP 23. Tracker Returns Compact Peer Lists](https://www.bittorrent.org/beps/bep_0023.html)
#[derive(PartialEq, Debug)]
Expand Down
3 changes: 0 additions & 3 deletions packages/http-protocol/src/v1/requests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//! HTTP requests for the HTTP tracker.
//!
//! Refer to the generic [HTTP server documentation](crate::servers::http) for
//! more information about the HTTP tracker.
pub mod announce;
pub mod scrape;
2 changes: 1 addition & 1 deletion packages/http-protocol/src/v1/responses/announce.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `Announce` response for the HTTP tracker [`announce`](bittorrent_http_protocol::v1::requests::announce::Announce) request.
//! `Announce` response for the HTTP tracker [`announce`](crate::v1::requests::announce::Announce) request.
//!
//! Data structures and logic to build the `announce` response.
use std::io::Write;
Expand Down
4 changes: 2 additions & 2 deletions packages/http-protocol/src/v1/responses/error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `Error` response for the [`HTTP tracker`](crate::servers::http).
//! `Error` response for the HTTP tracker.
//!
//! Data structures and logic to build the error responses.
//!
Expand All @@ -15,7 +15,7 @@ use serde::Serialize;

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

/// `Error` response for the [`HTTP tracker`](crate::servers::http).
/// `Error` response for the HTTP tracker.
#[derive(Serialize, Debug, PartialEq)]
pub struct Error {
/// Human readable string which explains why the request failed.
Expand Down
3 changes: 0 additions & 3 deletions packages/http-protocol/src/v1/responses/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
//! HTTP responses for the HTTP tracker.
//!
//! Refer to the generic [HTTP server documentation](crate::servers::http) for
//! more information about the HTTP tracker.
pub mod announce;
pub mod error;
pub mod scrape;
Expand Down
2 changes: 1 addition & 1 deletion packages/http-protocol/src/v1/responses/scrape.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `Scrape` response for the HTTP tracker [`scrape`](bittorrent_http_protocol::v1::requests::scrape::Scrape) request.
//! `Scrape` response for the HTTP tracker [`scrape`](crate::v1::requests::scrape::Scrape) request.
//!
//! Data structures and logic to build the `scrape` response.
use std::borrow::Cow;
Expand Down
6 changes: 3 additions & 3 deletions src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
//! The tracker responds to the peer with the list of other peers in the swarm so that
//! the peer can contact them to start downloading pieces of the file from them.
//!
//! Once you have instantiated the `Tracker` you can `announce` a new [`peer::Peer`] with:
//! Once you have instantiated the `AnnounceHandler` you can `announce` a new [`peer::Peer`](torrust_tracker_primitives::peer::Peer) with:
//!
//! ```rust,no_run
//! use std::net::SocketAddr;
Expand Down Expand Up @@ -81,7 +81,7 @@
//! ```
//!
//! ```text
//! let announce_data = tracker.announce(&info_hash, &mut peer, &peer_ip).await;
//! let announce_data = announce_handler.announce(&info_hash, &mut peer, &peer_ip).await;
//! ```
//!
//! The `Tracker` returns the list of peers for the torrent with the infohash `3b245504cf5f11bbdbe1201cea6a6bf45aee1bc0`,
Expand Down Expand Up @@ -306,7 +306,7 @@
//! `c1277613db1d28709b034a017ab2cae4be07ae10` is the torrent infohash and `completed` contains the number of peers
//! that have a full version of the torrent data, also known as seeders.
//!
//! Refer to [`peer`] module for more information about peers.
//! Refer to [`peer`](torrust_tracker_primitives::peer) for more information about peers.
//!
//! # Configuration
//!
Expand Down
5 changes: 2 additions & 3 deletions src/servers/http/v1/services/announce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
//!
//! The service is responsible for handling the `announce` requests.
//!
//! It delegates the `announce` logic to the [`Tracker`](crate::core::Tracker::announce)
//! and it returns the [`AnnounceData`] returned
//! by the [`Tracker`].
//! It delegates the `announce` logic to the [`AnnounceHandler`] and it returns
//! the [`AnnounceData`].
//!
//! It also sends an [`statistics::event::Event`]
//! because events are specific for the HTTP tracker.
Expand Down

0 comments on commit 2f74caf

Please sign in to comment.