Skip to content

Commit d91ad84

Browse files
committed
refactor: replace Download module with MakeDownload for improved file handling
1 parent 941878e commit d91ad84

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/cmd/tasks.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ use crate::{
3737

3838
system::{
3939
markdown::Markdown,
40-
download::Download,
4140
reporting::Reporting,
41+
make_download::MakeDownload,
4242
},
4343
};
4444

@@ -113,15 +113,15 @@ impl Tasks {
113113

114114
if line_url.contains(Uris::PROVIDERS_DOMAINS[6]) {
115115
let scihub_url = SciHub::new(&line_url).get_pdf().await?;
116-
Download.download_doi(&scihub_url, &scihub_url, path).await?;
116+
MakeDownload.download_doi(&scihub_url, &scihub_url, path).await?;
117117
}
118118

119119
if line_url.contains(Uris::PROVIDERS_DOMAINS[7]) {
120120
ChatGPT::new(&line_url, &path).convert().await?;
121121
}
122122

123123
if !Providers::new(&line_url).check_provider_domain() {
124-
Download.download_line(&line_url, url, path).await?;
124+
MakeDownload.download_line(&line_url, url, path).await?;
125125
}
126126

127127
Ok(())
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ use crate::{
3131
},
3232
};
3333

34-
pub struct Download;
34+
pub struct MakeDownload;
3535

36-
impl Download {
36+
impl MakeDownload {
3737

3838
async fn make(&self, url: &str, path: &str) -> Result<String, Box<dyn Error>> {
3939
UrlMisc::check_url_status(url).await?;

src/system/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pub mod doi;
33
pub mod general;
44
pub mod scripts;
55
pub mod markdown;
6-
pub mod download;
6+
pub mod make_download;
77
pub mod providers;
88
pub mod reporting;
99
pub mod plataforms;

0 commit comments

Comments
 (0)