From d03e930c1a842f46473cf3fb0d59e2638a0abfef Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Tue, 2 Jan 2024 15:55:53 +0000 Subject: [PATCH] feat!: [#536] remove always-empty peer list in torrent list item It's unused. --- src/servers/apis/v1/context/torrent/resources/torrent.rs | 5 ----- tests/servers/api/v1/contract/context/torrent.rs | 3 --- 2 files changed, 8 deletions(-) diff --git a/src/servers/apis/v1/context/torrent/resources/torrent.rs b/src/servers/apis/v1/context/torrent/resources/torrent.rs index 74577a23..fc43fbb7 100644 --- a/src/servers/apis/v1/context/torrent/resources/torrent.rs +++ b/src/servers/apis/v1/context/torrent/resources/torrent.rs @@ -44,9 +44,6 @@ pub struct ListItem { /// The torrent's leechers counter. Active peers that are downloading the /// torrent. pub leechers: u64, - /// The torrent's peers. It's always `None` in the struct and `null` in the - /// JSON response. - pub peers: Option>, // todo: this is always None. Remove field from endpoint? } impl ListItem { @@ -90,7 +87,6 @@ impl From for ListItem { seeders: basic_info.seeders, completed: basic_info.completed, leechers: basic_info.leechers, - peers: None, } } } @@ -156,7 +152,6 @@ mod tests { seeders: 1, completed: 2, leechers: 3, - peers: None, } ); } diff --git a/tests/servers/api/v1/contract/context/torrent.rs b/tests/servers/api/v1/contract/context/torrent.rs index ab497787..3cac55e6 100644 --- a/tests/servers/api/v1/contract/context/torrent.rs +++ b/tests/servers/api/v1/contract/context/torrent.rs @@ -35,7 +35,6 @@ async fn should_allow_getting_torrents() { seeders: 1, completed: 0, leechers: 0, - peers: None, // Torrent list does not include the peer list for each torrent }], ) .await; @@ -65,7 +64,6 @@ async fn should_allow_limiting_the_torrents_in_the_result() { seeders: 1, completed: 0, leechers: 0, - peers: None, // Torrent list does not include the peer list for each torrent }], ) .await; @@ -95,7 +93,6 @@ async fn should_allow_the_torrents_result_pagination() { seeders: 1, completed: 0, leechers: 0, - peers: None, // Torrent list does not include the peer list for each torrent }], ) .await;