Skip to content

Commit 1a4e418

Browse files
committed
fix: Added two new methods for DonwloadOptions in order to simplify the API and remove linter errors
1 parent 7e6793f commit 1a4e418

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/download.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ impl<'a> DownloadOptions<'a> {
7070
data_type: &'a str,
7171
paths: &'a str,
7272
dst: &'a str,
73-
threads: usize,
74-
max_retries: usize,
7573
numbered: bool,
7674
files_only: bool,
7775
progress: bool,
@@ -86,13 +84,19 @@ impl<'a> DownloadOptions<'a> {
8684
data_type,
8785
paths: Path::new(paths),
8886
dst: Path::new(dst),
89-
threads,
90-
max_retries,
87+
threads: 10,
88+
max_retries: 1000,
9189
numbered,
9290
files_only,
9391
progress,
9492
}
9593
}
94+
pub fn set_threads(&mut self, threads: usize) {
95+
self.threads = threads;
96+
}
97+
pub fn set_max_retries(&mut self, max_retries: usize) {
98+
self.max_retries = max_retries;
99+
}
96100
}
97101

98102
fn crawl_name_format(crawl: &str) -> Result<String, String> {

0 commit comments

Comments
 (0)