diff options
author | fx <[email protected]> | 2023-04-23 21:57:09 +0200 |
---|---|---|
committer | fx <[email protected]> | 2023-04-23 21:57:09 +0200 |
commit | 99c84b5a81f395f4f094b157019e84bfc4459df6 (patch) | |
tree | f852fd5cc3b26a004cf7bfab054e86c0d74c4669 /src/cache.rs | |
parent | 416f4dc383ff5a1194da3a5532a8e159a4a1dac0 (diff) | |
parent | 3e65975227baa511f570e8223fccda5607cf905e (diff) | |
download | modlist-99c84b5a81f395f4f094b157019e84bfc4459df6.tar modlist-99c84b5a81f395f4f094b157019e84bfc4459df6.tar.gz modlist-99c84b5a81f395f4f094b157019e84bfc4459df6.zip |
Merge pull request 'added config argument, remove devdir' (#2) from dev into cache
Reviewed-on: http://raspberrypi.fritz.box:7920/fx/modlist/pulls/2
Diffstat (limited to 'src/cache.rs')
-rw-r--r-- | src/cache.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/cache.rs b/src/cache.rs index 30c9f09..44029e0 100644 --- a/src/cache.rs +++ b/src/cache.rs | |||
@@ -1,7 +1,5 @@ | |||
1 | use std::{collections::HashMap, fs::{read_dir, copy}}; | 1 | use std::{collections::HashMap, fs::{read_dir, copy}}; |
2 | 2 | ||
3 | use crate::devdir; | ||
4 | |||
5 | /// . | 3 | /// . |
6 | /// | 4 | /// |
7 | /// # Panics | 5 | /// # Panics |
@@ -9,7 +7,7 @@ use crate::devdir; | |||
9 | /// Panics if . | 7 | /// Panics if . |
10 | pub fn get_cached_versions(path: &str) -> HashMap<String, String> { | 8 | pub fn get_cached_versions(path: &str) -> HashMap<String, String> { |
11 | let mut versions: HashMap<String, String> = HashMap::new(); | 9 | let mut versions: HashMap<String, String> = HashMap::new(); |
12 | for file in read_dir(devdir(path)).unwrap() { | 10 | for file in read_dir(path).unwrap() { |
13 | let path = file.unwrap().path(); | 11 | let path = file.unwrap().path(); |
14 | if path.is_file() && path.extension().ok_or("BAH").unwrap() == "jar" { | 12 | if path.is_file() && path.extension().ok_or("BAH").unwrap() == "jar" { |
15 | let pathstr = path.to_str().ok_or("BAH").unwrap(); | 13 | let pathstr = path.to_str().ok_or("BAH").unwrap(); |