diff options
Diffstat (limited to 'src/files.rs')
-rw-r--r-- | src/files.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/files.rs b/src/files.rs index 998ed32..14e5636 100644 --- a/src/files.rs +++ b/src/files.rs | |||
@@ -85,12 +85,12 @@ pub fn get_file_path(list: List, versionid: String) -> MLE<String> { | |||
85 | Ok(filename.to_owned()) | 85 | Ok(filename.to_owned()) |
86 | } | 86 | } |
87 | 87 | ||
88 | pub fn get_downloaded_versions(list: List) -> Result<HashMap<String, String>, Box<dyn std::error::Error>> { | 88 | pub fn get_downloaded_versions(list: List) -> MLE<HashMap<String, String>> { |
89 | let mut versions: HashMap<String, String> = HashMap::new(); | 89 | let mut versions: HashMap<String, String> = HashMap::new(); |
90 | for file in read_dir(&list.download_folder)? { | 90 | for file in read_dir(&list.download_folder)? { |
91 | let path = file?.path(); | 91 | let path = file?.path(); |
92 | if path.is_file() && path.extension().ok_or("BAH")? == "jar" { | 92 | if path.is_file() && path.extension().ok_or("BAH").unwrap() == "jar" { |
93 | let pathstr = path.to_str().ok_or("BAH")?; | 93 | let pathstr = path.to_str().ok_or("BAH").unwrap(); |
94 | let namesplit: Vec<&str> = pathstr.split('.').collect(); | 94 | let namesplit: Vec<&str> = pathstr.split('.').collect(); |
95 | versions.insert(String::from(namesplit[namesplit.len() - 3]), String::from(namesplit[namesplit.len() - 2])); | 95 | versions.insert(String::from(namesplit[namesplit.len() - 3]), String::from(namesplit[namesplit.len() - 2])); |
96 | } | 96 | } |