Skip to content

Commit

Permalink
refactor: [#296] rename vars
Browse files Browse the repository at this point in the history
to follow type name.
  • Loading branch information
josecelano committed Sep 19, 2023
1 parent fc95453 commit c308281
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/databases/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Torrent, Error> {
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<Torrent, Error> {
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
Expand Down

0 comments on commit c308281

Please sign in to comment.