diff options
author | fxqnlr <[email protected]> | 2022-12-28 13:15:10 +0100 |
---|---|---|
committer | fxqnlr <[email protected]> | 2022-12-28 13:15:10 +0100 |
commit | 5326d48f6e0a88ad42005c39b73f7baaf91c9b86 (patch) | |
tree | 154ff8715a2e0f121b285870d52c50f1737f7abc /src/files.rs | |
parent | e1c79889d3bf02c8d131d642fed8ba7ef9521bf4 (diff) | |
download | modlist-5326d48f6e0a88ad42005c39b73f7baaf91c9b86.tar modlist-5326d48f6e0a88ad42005c39b73f7baaf91c9b86.tar.gz modlist-5326d48f6e0a88ad42005c39b73f7baaf91c9b86.zip |
added devdir; better config dir
Diffstat (limited to 'src/files.rs')
-rw-r--r-- | src/files.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/files.rs b/src/files.rs index b1e537c..a3f838a 100644 --- a/src/files.rs +++ b/src/files.rs | |||
@@ -28,7 +28,7 @@ async fn download_file(url: String, path: String, name: String) -> Result<(), Bo | |||
28 | .await?; | 28 | .await?; |
29 | 29 | ||
30 | // download chunks | 30 | // download chunks |
31 | let mut file = File::create(String::from(&dl_path_file))?; | 31 | let mut file = File::create(&dl_path_file)?; |
32 | let mut stream = res.bytes_stream(); | 32 | let mut stream = res.bytes_stream(); |
33 | 33 | ||
34 | while let Some(item) = stream.next().await { | 34 | while let Some(item) = stream.next().await { |
@@ -78,7 +78,7 @@ pub fn get_file_path(list: List, versionid: String) -> Result<String, Box<dyn st | |||
78 | 78 | ||
79 | pub fn get_downloaded_versions(list: List) -> Result<HashMap<String, String>, Box<dyn std::error::Error>> { | 79 | pub fn get_downloaded_versions(list: List) -> Result<HashMap<String, String>, Box<dyn std::error::Error>> { |
80 | let mut versions: HashMap<String, String> = HashMap::new(); | 80 | let mut versions: HashMap<String, String> = HashMap::new(); |
81 | for file in read_dir(list.download_folder)? { | 81 | for file in read_dir(&list.download_folder)? { |
82 | let path = file?.path(); | 82 | let path = file?.path(); |
83 | if path.is_file() && path.extension().ok_or("BAH")? == "jar" { | 83 | if path.is_file() && path.extension().ok_or("BAH")? == "jar" { |
84 | let pathstr = path.to_str().ok_or("BAH")?; | 84 | let pathstr = path.to_str().ok_or("BAH")?; |