clippy and update
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2023-08-19 20:01:27 +02:00
parent 12378cb3c7
commit 4e67706c04
2 changed files with 57 additions and 58 deletions

View File

@ -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) {