From 1660fd5a5180c5e9f64be12eaa08919ef152bc1e Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Tue, 19 Sep 2023 10:44:44 +0100 Subject: [PATCH] refactor: [#296] rename vars to follow type name. --- src/databases/database.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/databases/database.rs b/src/databases/database.rs index e947090a..9205d843 100644 --- a/src/databases/database.rs +++ b/src/databases/database.rs @@ -203,24 +203,24 @@ pub trait Database: Sync + Send { /// Get `Torrent` from `InfoHash`. async fn get_torrent_from_info_hash(&self, info_hash: &InfoHash) -> Result { - let torrent_info = self.get_torrent_info_from_info_hash(info_hash).await?; + let db_torrent = self.get_torrent_info_from_info_hash(info_hash).await?; - let torrent_files = self.get_torrent_files_from_id(torrent_info.torrent_id).await?; + let torrent_files = self.get_torrent_files_from_id(db_torrent.torrent_id).await?; - let torrent_announce_urls = self.get_torrent_announce_urls_from_id(torrent_info.torrent_id).await?; + let torrent_announce_urls = self.get_torrent_announce_urls_from_id(db_torrent.torrent_id).await?; - Ok(Torrent::from_database(&torrent_info, &torrent_files, torrent_announce_urls)) + Ok(Torrent::from_database(&db_torrent, &torrent_files, torrent_announce_urls)) } /// Get `Torrent` from `torrent_id`. async fn get_torrent_from_id(&self, torrent_id: i64) -> Result { - let torrent_info = self.get_torrent_info_from_id(torrent_id).await?; + let db_torrent = self.get_torrent_info_from_id(torrent_id).await?; let torrent_files = self.get_torrent_files_from_id(torrent_id).await?; let torrent_announce_urls = self.get_torrent_announce_urls_from_id(torrent_id).await?; - Ok(Torrent::from_database(&torrent_info, &torrent_files, torrent_announce_urls)) + Ok(Torrent::from_database(&db_torrent, &torrent_files, torrent_announce_urls)) } /// It returns the list of all infohashes producing the same canonical