This commit is contained in:
@ -31,12 +31,8 @@ pub fn save_to_cache(ip: &str, data: &IpLocation) {
|
||||
}
|
||||
|
||||
pub fn get_from_cache(ip: &str) -> Option<IpLocation> {
|
||||
let cache_dir = get_cache_dir();
|
||||
if cache_dir.is_none() {
|
||||
return None;
|
||||
}
|
||||
let mut cache_dir = get_cache_dir()?;
|
||||
|
||||
let mut cache_dir = cache_dir.unwrap();
|
||||
cache_dir.push(format!("{}.{}", ip, "json"));
|
||||
|
||||
if !is_in_cache(&cache_dir) {
|
||||
|
Reference in New Issue
Block a user