Skip to content

Commit 5acbb13

Browse files
committed
fix: formatting errors
1 parent 9b3b75b commit 5acbb13

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ pub mod bootstrap;
494494
pub mod console;
495495
pub mod core;
496496
pub mod servers;
497-
pub mod shared;
497+
pub mod shared;
498498

499499
#[macro_use]
500500
extern crate lazy_static;

src/servers/udp/server.rs

+10-13
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,11 @@ impl Drop for ActiveRequests {
235235
}
236236

237237
/// Wrapper for Tokio [`UdpSocket`][`tokio::net::UdpSocket`] that is bound to a particular socket.
238-
struct Socket {
238+
struct BoundSocket {
239239
socket: Arc<tokio::net::UdpSocket>,
240240
}
241241

242-
impl Socket {
242+
impl BoundSocket {
243243
async fn new(addr: SocketAddr) -> Result<Self, Box<std::io::Error>> {
244244
let socket = tokio::net::UdpSocket::bind(addr).await;
245245

@@ -257,15 +257,15 @@ impl Socket {
257257
}
258258
}
259259

260-
impl Deref for Socket {
260+
impl Deref for BoundSocket {
261261
type Target = tokio::net::UdpSocket;
262262

263263
fn deref(&self) -> &Self::Target {
264264
&self.socket
265265
}
266266
}
267267

268-
impl Debug for Socket {
268+
impl Debug for BoundSocket {
269269
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
270270
let local_addr = match self.socket.local_addr() {
271271
Ok(socket) => format!("Receiving From: {socket}"),
@@ -334,7 +334,7 @@ impl Udp {
334334
format!("Halting UDP Service Bound to Socket: {bind_to}"),
335335
));
336336

337-
let socket = tokio::time::timeout(Duration::from_millis(5000), Socket::new(bind_to))
337+
let socket = tokio::time::timeout(Duration::from_millis(5000), BoundSocket::new(bind_to))
338338
.await
339339
.expect("it should bind to the socket within five seconds");
340340

@@ -543,17 +543,14 @@ impl Udp {
543543

544544
#[cfg(test)]
545545
mod tests {
546-
use std::{sync::Arc, time::Duration};
546+
use std::sync::Arc;
547+
use std::time::Duration;
547548

548549
use torrust_tracker_test_helpers::configuration::ephemeral_mode_public;
549550

550-
use crate::{
551-
bootstrap::app::initialize_with_configuration,
552-
servers::{
553-
registar::Registar,
554-
udp::server::{Launcher, UdpServer},
555-
},
556-
};
551+
use crate::bootstrap::app::initialize_with_configuration;
552+
use crate::servers::registar::Registar;
553+
use crate::servers::udp::server::{Launcher, UdpServer};
557554

558555
#[tokio::test]
559556
async fn it_should_be_able_to_start_and_stop() {

0 commit comments

Comments
 (0)