|
4 | 4 | //! and resolve the client IP address.
|
5 | 5 | use std::sync::Arc;
|
6 | 6 |
|
7 |
| -use aquatic_udp_protocol::AnnounceEvent; |
8 | 7 | use axum::extract::State;
|
9 | 8 | use axum::response::{IntoResponse, Response};
|
10 | 9 | use bittorrent_http_tracker_core::services::announce::HttpAnnounceError;
|
11 |
| -use bittorrent_http_tracker_protocol::v1::requests::announce::{Announce, Compact, Event}; |
| 10 | +use bittorrent_http_tracker_protocol::v1::requests::announce::{Announce, Compact}; |
12 | 11 | use bittorrent_http_tracker_protocol::v1::responses::{self};
|
13 | 12 | use bittorrent_http_tracker_protocol::v1::services::peer_ip_resolver::ClientIpSources;
|
14 | 13 | use bittorrent_tracker_core::announce_handler::AnnounceHandler;
|
@@ -158,30 +157,6 @@ fn build_response(announce_request: &Announce, announce_data: AnnounceData) -> R
|
158 | 157 | }
|
159 | 158 | }
|
160 | 159 |
|
161 |
| -#[must_use] |
162 |
| -pub fn map_to_aquatic_event(event: &Option<Event>) -> aquatic_udp_protocol::AnnounceEvent { |
163 |
| - match event { |
164 |
| - Some(event) => match &event { |
165 |
| - Event::Started => aquatic_udp_protocol::AnnounceEvent::Started, |
166 |
| - Event::Stopped => aquatic_udp_protocol::AnnounceEvent::Stopped, |
167 |
| - Event::Completed => aquatic_udp_protocol::AnnounceEvent::Completed, |
168 |
| - }, |
169 |
| - None => aquatic_udp_protocol::AnnounceEvent::None, |
170 |
| - } |
171 |
| -} |
172 |
| - |
173 |
| -#[must_use] |
174 |
| -pub fn map_to_torrust_event(event: &Option<Event>) -> AnnounceEvent { |
175 |
| - match event { |
176 |
| - Some(event) => match &event { |
177 |
| - Event::Started => AnnounceEvent::Started, |
178 |
| - Event::Stopped => AnnounceEvent::Stopped, |
179 |
| - Event::Completed => AnnounceEvent::Completed, |
180 |
| - }, |
181 |
| - None => AnnounceEvent::None, |
182 |
| - } |
183 |
| -} |
184 |
| - |
185 | 160 | #[cfg(test)]
|
186 | 161 | mod tests {
|
187 | 162 |
|
|
0 commit comments