diff options
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")?; |