Skip to content

Commit 941878e

Browse files
committed
refactor: rename download method to make for clarity in Download struct
1 parent bab5d03 commit 941878e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/cmd/tasks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ use crate::{
3636
},
3737

3838
system::{
39-
download::Download,
4039
markdown::Markdown,
40+
download::Download,
4141
reporting::Reporting,
4242
},
4343
};

src/system/download.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub struct Download;
3535

3636
impl Download {
3737

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

4141
let (request_uri, filename) = Providers::new(url).get_from_provider().await?;
@@ -65,7 +65,7 @@ impl Download {
6565

6666
pub async fn download_line(&self, line_url: &str, url: &str, path: &str) -> Result<String, Box<dyn Error>> {
6767
if Pdf.is_pdf_file(&line_url).await? || Providers::new(url).valid_provider_domain() && !line_url.contains(".md") {
68-
let result = self.download(&line_url, path).await;
68+
let result = self.make(&line_url, path).await;
6969

7070
match result {
7171
Ok(file) => {
@@ -84,7 +84,7 @@ impl Download {
8484
}
8585

8686
pub async fn download_doi(&self, line_url: &str, url: &str, path: &str) -> Result<String, Box<dyn Error>> {
87-
let result = self.download(&line_url, path).await;
87+
let result = self.make(&line_url, path).await;
8888

8989
match result {
9090
Ok(file) => {

0 commit comments

Comments
 (0)