@@ -7,11 +7,11 @@ use torrust_tracker_primitives::{peer, DurationSinceUnixEpoch, PersistentTorrent
77
88use crate :: entry:: peer_list:: PeerList ;
99use crate :: entry:: torrent:: Torrent ;
10- use crate :: EntryMutexStd ;
10+ use crate :: TorrentEntry ;
1111
1212#[ derive( Default , Debug ) ]
1313pub struct TorrentsSkipMapMutexStd {
14- pub torrents : SkipMap < InfoHash , EntryMutexStd > ,
14+ pub torrents : SkipMap < InfoHash , TorrentEntry > ,
1515}
1616
1717impl TorrentsSkipMapMutexStd {
@@ -53,15 +53,15 @@ impl TorrentsSkipMapMutexStd {
5353 tracing:: debug!( "Inserting new torrent: {:?}" , info_hash) ;
5454
5555 let new_entry = if let Some ( number_of_downloads) = opt_persistent_torrent {
56- EntryMutexStd :: new (
56+ TorrentEntry :: new (
5757 Torrent {
5858 swarm : PeerList :: default ( ) ,
5959 downloaded : number_of_downloads,
6060 }
6161 . into ( ) ,
6262 )
6363 } else {
64- EntryMutexStd :: default ( )
64+ TorrentEntry :: default ( )
6565 } ;
6666
6767 let inserted_entry = self . torrents . get_or_insert ( * info_hash, new_entry) ;
@@ -85,7 +85,7 @@ impl TorrentsSkipMapMutexStd {
8585 } )
8686 }
8787
88- pub fn get ( & self , key : & InfoHash ) -> Option < EntryMutexStd > {
88+ pub fn get ( & self , key : & InfoHash ) -> Option < TorrentEntry > {
8989 let maybe_entry = self . torrents . get ( key) ;
9090 maybe_entry. map ( |entry| entry. value ( ) . clone ( ) )
9191 }
@@ -107,7 +107,7 @@ impl TorrentsSkipMapMutexStd {
107107 metrics
108108 }
109109
110- pub fn get_paginated ( & self , pagination : Option < & Pagination > ) -> Vec < ( InfoHash , EntryMutexStd ) > {
110+ pub fn get_paginated ( & self , pagination : Option < & Pagination > ) -> Vec < ( InfoHash , TorrentEntry ) > {
111111 match pagination {
112112 Some ( pagination) => self
113113 . torrents
@@ -130,7 +130,7 @@ impl TorrentsSkipMapMutexStd {
130130 continue ;
131131 }
132132
133- let entry = EntryMutexStd :: new (
133+ let entry = TorrentEntry :: new (
134134 Torrent {
135135 swarm : PeerList :: default ( ) ,
136136 downloaded : * completed,
@@ -144,7 +144,7 @@ impl TorrentsSkipMapMutexStd {
144144 }
145145 }
146146
147- pub fn remove ( & self , key : & InfoHash ) -> Option < EntryMutexStd > {
147+ pub fn remove ( & self , key : & InfoHash ) -> Option < TorrentEntry > {
148148 self . torrents . remove ( key) . map ( |entry| entry. value ( ) . clone ( ) )
149149 }
150150
0 commit comments